问题描述
我想增加热图的字体大小,但我发现当图例名称长而图例组名称短时,图例很容易超出边距。例子如下:
test = matrix(rnorm(200),20,10)
test[1:10,seq(1,10,2)] = test[1:10,2)] + 3
test[11:20,seq(2,2)] = test[11:20,2)] + 2
test[15:20,2)] = test[15:20,2)] + 4
colnames(test) = paste("Test",1:10,sep = "")
rownames(test) = paste("Gene",1:20,sep = "")
annotation_col = data.frame(
C = factor(rep(c("longCT1","longCT2"),5))
)
rownames(annotation_col) = paste("Test",sep = "")
pheatmap::pheatmap(test,annotation_col = annotation_col,cluster_cols = F,scale = "row",fontsize = 20)
可以看到图例名称C
较短,而lenengned组名称longCTx
较长,设置大字体时,会超出边距:
那么在这种情况下,当我想增加热图的字体大小时如何解决?