我是热图的新手。我的数据看起来像:
Dat A B C D E
A 100 30.3 0 55.71 45.78
B 12.85 100 72.85 12.64 98.51
C 0 27.85 100 82.28 3.07
D 23.71 30.64 40.28 100 6.33
E 25.25 85 52.36 36.33 100
R代码:
pdf("hh.pdf")
library(gplots)
data = read.table("file.txt", header=T, row.names=1)
heatmap.2(as.matrix(data))
dev.off()
当我使用上面的数据绘制热图时,可以使用这些网格线。但是当我将行数计算为100或在该范围内时,情节几乎不可见。情节用短划线垂直线覆盖。
我想摆脱那些恼人的台词。我已经保存了.png
格式,但同样,我得到相同的行。
我检查了heatmap.2 (gplots package) - how to remove annoying lines in some cells?
使用R 3.0.2
pdf("hh.pdf")
library(gplots)
data = read.table(text="Dat A B C D E
A 100 30.3 0 55.71 45.78
B 12.85 100 72.85 12.64 98.51
C 0 27.85 100 82.28 3.07
D 23.71 30.64 40.28 100 6.33
E 25.25 85 52.36 36.33 100", header=T, row.names=1)
heatmap.2(as.matrix(data), tracecol=NA)
得到它了:
pdf("test.pdf")
data = read.table("srg.txt", header=T, row.names=1)
heatmap.2(as.matrix(data), dendrogram=c("row"),density.info="none", trace="none",symm=T)
dev.off()
我建议也使用包“pheatmap”如下:
pheatmap(as.matrix(data))
。
它比ggplots heatmap强大得多。