Entering edit mode

12 months ago

mropri
▴
140

I have the following code which created a heatmap for my correlation matrix.

```
corrplot(cor, method = "circle", type = "full", is.corr = TRUE, p.mat = pAdj, sig.level = 0.05, insig = "label_sig" )
```

my matrix cor has 816 rows and 11 columns. is there a way I can stretch the heatmap so it is readable. At the moment it looks like this:

Play around with it. What have you tried to do by yourself before deciding to ask people here?

How is your

`cor`

matrix not square? Have you understood what corrplot needs or are you just passing it your raw matrix?Looking at your past posts, it looks like you're asking here where you could just be Googling for answers. Please invest some effort and come to us only when you've tried your best.

Hi Ram,

Thank you for your help. I have tried multiple ways and researching on google. I tried playing with the par function to correct margin size and other ways to stretch out the heatmap. Also, i kept order = "original" since my matrix is not square and yes it is a matrix of correlations. I have tried my best, but I am sorry for the bother and will keep trying. Thank you again for the help.

The raw 816x11 matrix should work and you should see 11 rows and 11 columns in your corrplot. Your reasoning for

`order`

doesn't really make sense - it doesn't matter that your matrix is not square as it looks like the order is applied after internally creating the correlation square matrix.For starters, try creating the corr matrix yourself. What does

`cor(the_816_by_11_data)`

give you? It should give you a 11-by-11 array. I think your data is being transposed somehow into 11 by 816 instead of 816 by 11.Hi Ram,

I created the cor matrix myself and then gave it as an input into the corrplot function.

The reason I am confused is because when I plot the upper triangle of the matrix it looks like what I want. However when I do the full matrix plot it gets crunched up. The cor data frame I have is 816 rows by 11 columns data frame.

Can you show me

`head(rownames(cor))`

and`head(colnames(cor))`

?Try this:

Tried it out, produces this:

I feel its plotting it fine, its just a large matrix so the figure just needs to be enlarged. Appreciate your help on this and sorry for the bother. I will try it out and if I can not get it, not a big deal.

Can you show me your full code please? Maybe that'll help debug what's happening. If that doesn't solve it, we can look at your full dataset.

Sorry for the late response. Here is my code and you truly are helpful. Cannot thank you enough

This does not make sense to me. I thought you were correlating one matrix's columns against one another, not 2 matrices.

Can you show me the output to:

I think the matrix is just too big for it to be readable. Because the code the you asked me to give the output gives the plot perfectly fine.