r - R 中的 corrplot 参数

标签 r plot r-corrplot

我使用了如下的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()

enter image description here

最佳答案

问题似乎出在 png() 以及您提供的 height=1200width=1200 选项上。尝试将该行更改为:

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

出于某种原因,默认的pointsize = 12会以某种方式减少标签标题的字体。

编辑:要正确查看标题,请将此参数添加到您的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()

关于r - R 中的 corrplot 参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14753344/

相关文章:

plot - CorePlot 图中的外边距

r - 根据ggplot中的组分配许多线条颜色

r - 将背景颜色设置为 corrplot 中数据的强度

r - 在 corrplot 矩阵中添加 p 值

R 是否在 GUI 中运行?

r - 从回归估计中提取交互作用项

r - 将ggplot中 strip 标签的位置从顶部更改为底部?

r - 使用cowplot的plot_grid放置图例

matlab - MATLAB 中绘图的多个 x 轴和 y 轴

r - 即使设置了 insig = "blank",corrplot 也显示不显着的相关系数