R中的热图如何调整列标签的大小? [英] heatmap in R how to resize columns labels?
问题描述
我有一个约4000行100列的data.matrix.我正在对数据进行热图绘制,例如:
I have a data.matrix that is approximately 4000 rows and 100 columns. I am doing a heatmap of the data like:
data<-heatmap(data_matrix,Rowv=NA,Colv=NA,col=cm.colors(256),scale="column",margins=c(5,10))
但是我得到的问题是,列中出现的标签过于分组,因此无法正确地可视化它们.如何调整热图的大小,以便可以看到列标签的值?我尝试将其打印为pdf,但它仅显示黑色条纹.谢谢
But the problem that I got is that the labels that appear in the column are too grouped, so it is impossible to visualize them correctly. How I can resize the heatmap so I can see the values of the labels of the column? I tried to print it in pdf, but it only appears a black stripe. Thanks
我包括一个热图图,我想看的部分是标签在右边的部分,但它们太靠近了.
I am including a figure of the heatmap, the portion that I want to see are the labels that are in the right part, but they are too close together.
推荐答案
在Rstudio中,您可以轻松调整图形窗口的大小,这与Rgui相同.另外,如果您将图解保存到文件中,则可以为图形使用更大的尺寸,例如调用 pdf
或 png
时,较大的 width
和 height
.
In Rstudio you can easily resize the graphic window, same holds for Rgui. Alternatively, if you save the plot to file you can use a bigger size for your graphics, e.g. bigger width
and height
when calling pdf
or png
.
这篇关于R中的热图如何调整列标签的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!