简体   繁体   中英

reduce width of columns on a heatmap.2 plot

I have a 331*9 double matrix (named expr001). It looks like this:

row.names     Col1      Col2      Col3      Col4      Col5      Col6    Col7       Col8      Col9
17211382  7.397439  7.377975  7.299997  8.192889  8.292300  8.092921  8.178948  8.120986  8.276824
17211752  9.115307  9.116741  9.113366  8.423073  8.458392  8.573309  8.773752  8.614159  8.592105
17212229  5.968911  6.060437  6.059898  5.595364  5.471327  5.538794  5.584753  5.518935  5.498830
17215629  8.641765  8.810358  8.770533  7.482992  7.732727  7.811839  8.582255  8.404402  8.357516
17215820 11.495858 11.605611 11.529879 11.124909 11.107311 11.179045 11.165894 11.188668 11.210991

And I am generating a heatmap using heatmap.2

heatmap.2(expr001,main="\n331 Genes : P.adj<0.01",cexCol=0.9,tracecol=NULL,col="bluered")

I get the plot below:

在此处输入图片说明

How can I reduce the width of the columns? Any suggestions?

Try pheatmap package. There you can control the size of the the cells more conveniently, with arguments cellwidth and cellheight . Even if your plot becomes too big this way and does not fit into the plotting window, then by using argument filename you can write it into file with correct measurements.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM