Entering edit mode
3.1 years ago
Bioinf_Questions
•
0
Hello. I'm making a heatmap of my data using heatmap.2, but once the plot is done there is no color scale. Shouldn't it be done automatically? What function should I use to put it in the plot?
Also, I'm getting the mesage "Error in plot.new() : figure margins too large". I used the function margins =c() to lower the margins so that the image isn't cut, but I still get the mesage. Do I need to change something or is there no problem even if I get that mesage?
Thanks in advance.
Hi,
I guess that the color scale is not appearing due to the error that you're getting
"Error in plot.new() : figure margins too large"
, so its being cut. This is my guess since I just searched for that function and it seems that gives a color scale (see the link).Which are the dimensions (rows x cols) of your matrix? (that you're providing to the function)
António
There are 4 columns and 50 rows.
I just tried on RStudio (v.2021.09.0 Build 351), with R version 4.1.2,
gplots
version 3.1.1, on Ubuntu 20.04.3 LTS, and it worked fine.The dummy example that I used:
Perhaps try to avoid giving the
margins
option/function first to see if it works.I guess that this also depends on how long are your label row names and col names.
I hope this helps,
António
Thank you very much.
are you using rstudio while plotting this?
Yes, I am.
One reason could be plot window (panel) is not big. Just drag the borders of plotting window to make it bigger.