I have:
library(gplots);
x<-matrix(seq(1:100),nrow=10,byrow=TRUE);
heatmap.2(x, Rowv=NA, Colv=NA, scale="none", main="This title will be cut off by the white space where the non-existant key is supposed to go.", col=gray((255:0)/255), dendrogram="none",trace="none", key=FALSE);
When the key is specified as FALSE, there's a block of white-space on the left side of the plot that prevents the full title from showing up, conflicts with manual specification of smaller margins, and moves the heat-map toward the right. The width of the white-space is controllable using "keysize=#"
, but making it too small (somewhere between 0.8 and 1.0) creates an error: "Error in plot.new() : figure margins too large"
I would try doing this with heatmap()
instead of heatmap.2()
, but heatmap doesn't play well with par()
which I need for a project. If anyone has any suggestions, I'd appreciate it.