【问题标题】:corrplot parameters in RR中的corrplot参数
【发布时间】:2013-01-23 02:01:02
【问题描述】:

我使用了如下的 corrplot,但正如你所见,我需要放大圆圈内数字的字体大小,然后绘图标题的位置和字体大小不正确(不完全可见),但我可以找不到他们的参数。如果您能提供帮助,我将不胜感激。

library(corrplot)

png(height=1200, width=1200, file="overlap.png")

col1 <-rainbow(100, s = 1, v = 1, start = 0, end = 0.9, alpha = 1)
test <- matrix(data=c(20:60),nrow=7,ncol=7)

corrplot(test,tl.cex=3,title="Overlaps Between methods",
  method="circle",is.corr=FALSE,type="full",
  cl.lim=c(10,100),cl.cex=2,addgrid.col="red",
  addshade="positive",col=col1, diag=FALSE,
  addCoef.col = rgb(0,0,0, alpha = 0.6)
)

dev.off()

【问题讨论】:

  • @Arun,现在我认为它是可重现的。我需要更改圆圈内文本的字体大小。但也许它们与其他一些参数成正比。
  • 在我的Rstudio 上,它打印得非常好!问题似乎出在png 中的height=width= 参数上。如果您删除它,它会产生良好的效果。更好的是pdf("myfile.pdf")
  • @Arun 甚至标题?你也使用了 png 和 dev.off 吗?
  • 检查答案。我想这就是你要找的东西..?

标签: r plot r-corrplot


【解决方案1】:

问题似乎与您提供的png()height=1200width=1200 选项有关。尝试将该行更改为:

png(height=1200, width=1200, pointsize=25, file="overlap.png")

出于某种原因,默认的pointsize = 12 以某种方式减少了labelstitle 的字体。

编辑:要正确查看标题,请将此参数添加到您的corrplot

mar=c(0,0,1,0)

所以整个命令集是:

library(corrplot)
png(height=1200, width=1200, pointsize=25, file="overlap.png")
col1 <-rainbow(100, s = 1, v = 1, start = 0, end = 0.9, alpha = 1)
test <- matrix(data=c(20:60),nrow=7,ncol=7)
corrplot(test,tl.cex=3,title="Overlaps Between methods",
method="circle",is.corr=FALSE,type="full",
cl.lim=c(10,100),cl.cex=2,addgrid.col=
"red",addshade="positive",col=col1, addCoef.col = rgb(0,0,0, alpha =
0.6), mar=c(0,0,1,0), diag= FALSE) 
dev.off()

【讨论】:

  • 2021 年,将代码块粘贴到 R 中似乎不再有效。错误是null device
猜你喜欢
  • 2018-01-14
  • 2021-01-21
  • 2016-06-28
  • 2017-03-20
  • 1970-01-01
  • 1970-01-01
  • 2017-12-05
  • 2017-03-06
  • 2015-03-22
相关资源
最近更新 更多