我使用了下面的 R 列表并得到了一个非常好的热图
:
png( "test-8.png", width =800 , height =750 )
heatmap(1-cor(df),distfun=function(x){as.dist(x)},symm=F,Rowv=NULL, Colv=NULL)
dev.off()
但它是用相当低的分辨率制作的。经过谷歌搜索我找到了可能的解决方案:
png( "test-8.png", width =800 , height =750,res=600 )
heatmap(1-cor(df),distfun=function(x){as.dist(x)},symm=F,Rowv=NULL, Colv=NULL)
dev.off()
不幸的是,我在代码执行后收到错误消息:
Error in par(op) : invalid value specified for graphical parameter "pin"
Calls: heatmap -> par
Execution halted
我该如何管理它?任何建议将不胜感激。
最佳答案
您的设置可能会将pin
大小降低到允许的最小值以下(仍在寻找相关文档)。尝试使用以下内容。您可能需要加载grid
包才能使units参数起作用。
png("high_res.png", width = 4, height = 4, units = 'in', res = 600)
heatmap(1-cor(df),distfun=function(x){as.dist(x)},symm=F,Rowv=NULL, Colv=NULL)
dev.off()
关于r - r 中的高分辨率热图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31793271/