How to change the margins of a correlation matrix plot?

你。 提交于 2019-12-12 18:26:00

问题


I couldn't find any option to expand the margins for plot generated by corrplot.mixed in the corrplot package. Any suggestion would be appreciated!

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)

回答1:


Answer my own question for future readers

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



来源:https://stackoverflow.com/questions/39029526/how-to-change-the-margins-of-a-correlation-matrix-plot

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!