【发布时间】:2018-07-05 13:04:10
【问题描述】:
我尝试将热图保存在 png 中。
png(paste(colnames(pt2)[jj], "_heatmap.png", sep=""), width = 465, height = 225, res = 300)
heatmap.2(S5, Rowv=F,Colv=F, scale="none", trace="none", col=rg, mar=c(3.5,0,3,0),
dendrogram = "none", key=TRUE, keysize=0.2, key.par=list(cex=0.1),
xlab="hour of the day", ylab = "day of the week",
density.info = "none", lmat=rbind(c(5, 4, 2), c(6, 1, 3)),
lhei=c(3, 4.5), lwid=c(0.1, 5, 1),
cexRow=1, cexCol=1, margins = c(3,0))
dev.off()
但它仅适用于 res=100 最大值。我还尝试将其保存到具有 10X 高度和宽度的文件中,例如宽度 = 4650,高度 = 2250。但是我无法更改键的字体大小,它太小而且看不见。如何解决高分辨率?它显示
Error in plot.new() : figure margins too large
Error in par(op) : invalid value specified for graphical parameter "pin"
【问题讨论】:
-
不是直接解决问题的方法,但也许可以使用
ggplot2生成热图,可以在这里看到stackoverflow.com/questions/12732412/…