Resize and set up the heatmap in the heatmap .2

I created a heatmap as follows: enter image description here

The signs of the X-axis and Y-axis are not displayed completely. My code is here:

heatmap.2(x,col=blueyelred,colsep=c(1:6),rowsep=(1:62), sepwidth=c(0.05,0.05), sepcolor="white", trace="none", Rowv=F,Colv=F, scale="none", dendrogram="none",key=F, lhei = c(0.05,5),margins=c(1,8)) 

Is there any way to adjust it.

Thanks! Cam

+7
r heatmap
source share
2 answers

A few tips:

  • to reduce font size, use cexRow and cexCol , for example

     heatmap.2(x, ...., cexRow=0.5) 
  • Adjust the values ​​in the hlei and margins arguments.

+8
source share

I see that you are already using the margins parameter, what if you just change the arguments as suggested by @csgillespie?

e.g. margins = c(8, 8)

It is also possible to change the main fields of the graph before calling the heatmap() function can help

e.g. par(mar=c(10,4,4,2))

or for an external field

par(oma=c(10,4,4,2))

where par(mar=c(bottom,left,top,right))

+4
source share

All Articles