R Corrplot正方形(平铺)大小

R Corrplot square (tile) size

我正在使用 method="number." 绘制包含 10 个变量的相关图 我正在尝试导出大字体的图(number.cex = 3,tl.cex = 3) 用于出版目的,但方块的大小不会增加以适应较大的字体。有办法修改吗?

如果有帮助,这是我的代码:

corrplot(as.matrix(K), tl.cex = 3, tl.col = "black", method = "color", 
         outline = T,  order="hclust", 
         addCoef.col = "black", number.digits = 2, number.cex = 3, 
         cl.pos = 'b', cl.cex = 3, addrect = 3, rect.lwd = 3, 
         col = colorRampPalette(c("midnightblue", "white","darkred"))(100))

可能是一个非常愚蠢的想法,但根据您使用的 R 版本,您可以简单地使用 window 进入全屏,一旦您 运行 您的 [=12] =] 函数。这在过去对我有用。然后我想你应该确保选择正确的格式;例如 TIFF。

更复杂的解决方案当然是 this。这里的想法是在编写/保存后调整图形参数。这有意义吗?

一般来说,想法是这样的(具有可互换的格式类型):

tiff(filename=".tiff",width=...,height=...,res=...)

jpeg()

您可以尝试的软件包是 {grDevices} 或 {tiff},当然还有数百个。 ;)

让我知道这是否适合您。

干杯!

您应该调整图形输出文件的 widthheightres 参数。
请参阅下面的示例。

set.seed(1)
X = matrix(runif(1000),ncol=10)
library(corrplot)
png(file="corr.png", res=300, width=4500, height=4500)
corrplot(as.matrix(cor(X)), tl.cex = 3, tl.col = "black", method = "color", 
         outline = T,  order="hclust", 
         addCoef.col = "black", number.digits = 2, number.cex = 3, 
         cl.pos = 'b', cl.cex = 3, addrect = 3, rect.lwd = 3, 
         col = colorRampPalette(c("midnightblue", "white","darkred"))(100))
dev.off()