繁体   English   中英

如何更改相关矩阵图的边距?

[英]How to change the margins of a correlation matrix plot?

我找不到在corrplot包中扩展由corrplot.mixed生成的图的边距的任何选项。 任何建议,将不胜感激!

library(corrplot) 
cor_matrix <- structure(c(1, 0.31596392056465, -0.120092224085334, -0.345097115278159, 
                          0.31596392056465, 1, 0.158912865564527, -0.606426850726639, -0.120092224085334, 
                          0.158912865564527, 1, -0.134795548155303, -0.345097115278159, 
                          -0.606426850726639, -0.134795548155303, 1), .Dim = c(4L, 4L), 
                        .Dimnames = list(NULL, c("var_1", "var_2", "var_3", "var_4")))

corrplot.mixed(cor_matrix, order = "AOE", upper = "ellipse", lower = "number", 
               tl.cex = 2, cl.cex = 2, number.cex = 2)

为将来的读者回答我自己的问题

library(corrplot) 
library(scico)

col4 <- scico(100, palette = 'vik')
filetag <- "corrplot_result.png"

png(filetag, height = 800, width = 800)

  corrplot.mixed(cor_matrix, order = "AOE", upper = "ellipse", lower = "number", 
                 upper.col = col4, lower.col = col4,
                 tl.cex = 2, cl.cex = 2, number.cex = 2)
dev.off()

在此处输入图片说明

暂无
暂无

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

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