简体   繁体   English

R 中的 corrplot 参数

[英]corrplot parameters in R

I have used the corrplot as below, but as you can see I need to enlarge the font size of numbers inside the circles and then the plot title is not in a correct position and font size(not visible completely) but I can not find the parameters for them.我已经使用了如下的 corrplot,但是正如您所看到的,我需要放大圆圈内数字的字体大小,然后 plot 标题不在正确的 position 和字体大小(不完全可见)中,但我找不到他们的参数。 I will be grateful if you could help.如果您能提供帮助,我将不胜感激。

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()

在此处输入图像描述

The problem seems to be with the png() with the height=1200 and width=1200 options you provide. 问题似乎在于png() ,您提供的是height=1200width=1200选项。 Try changing that line to: 尝试将该行更改为:

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

The default pointsize = 12 somehow reduces the fonts of the labels and title , for some reason. 由于某种原因,默认的pointsize = 12以某种方式减少了labelstitle的字体。

Edit: To see the title properly add this parameter to your corrplot : 编辑:要正确查看标题,请将此参数添加到corrplot

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

So the entire command set is: 所以整个命令集是:

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()

Rename parameter cl.lim to col.lim in corrplot()https://cran.r-project.org/web/packages/corrplot/news/news.html在 corrplot()https: //cran.r-project.org/web/packages/corrplot/news/news.html 中将参数 cl.lim 重命名为 col.lim

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM