R中的Corrplot参数 [英] corrplot parameters in R
问题描述
我使用了如下Corrplot,但是如您所见,我需要扩大圆圈内数字的字体大小,然后情节标题位置和字体大小不正确(不完全可见),但是我可以找不到适合他们的参数.如果您能提供帮助,我将不胜感激.
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. 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()
推荐答案
问题似乎出在您提供的带有height=1200
和width=1200
选项的png()
上.尝试将该行更改为:
The problem seems to be with the png()
with the height=1200
and width=1200
options you provide. Try changing that line to:
png(height=1200, width=1200, pointsize=25, file="overlap.png")
由于某些原因,默认的pointsize = 12
会以某种方式减小labels
和title
的字体.
The default pointsize = 12
somehow reduces the fonts of the labels
and title
, for some reason.
要正确显示标题,请将此参数添加到您的corrplot
:
To see the title properly add this parameter to your 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中的Corrplot参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!