2016-08-19 8 views
2

corrplot.mixedで生成されたプロットの余白を拡大するオプションが見つからないcorrplotパッケージ。どんな提案もありがとう!相関行列プロットのマージンを変更する方法

  • マイデータ:

    cor_matrix <- structure(c(1, 0.31596392056465, -0.120092224085334, -0.345097115278159, 
    -0.360122240730762, -0.229557709493001, 0.31596392056465, 1, 
    0.158912865564527, -0.606426850726639, -0.351711315621928, -0.58324161013876, 
    -0.120092224085334, 0.158912865564527, 1, -0.134795548155303, 
    -0.118408957923256, -0.174432082510352, -0.345097115278159, -0.606426850726639, 
    -0.134795548155303, 1, 0.453896576795379, 0.658983612837725, 
    -0.360122240730762, -0.351711315621928, -0.118408957923256, 0.453896576795379, 
    1, 0.567187367816482, -0.229557709493001, -0.58324161013876, 
    -0.174432082510352, 0.658983612837725, 0.567187367816482, 1), .Dim = c(6L, 
    6L), .Dimnames = list(NULL, c("p1", "p2", "p3", "p4", "p5", "p6" 
    ))) 
    
  • 私のコード

    library(corrplot)  
    col4 <- c("#440154FF" ,"#414487FF" ,"#2A788EFF", "#22A884FF" ,"#7AD151FF" ,"#FDE725FF")  
    
    corrplot.mixed(cor_matrix, order = "AOE", upper = "ellipse", lower = "number", col = col4, 
           tl.cex = 1.2, cl.cex = 1.2) 
    
  • 出力

enter image description here

+1

私はパッケージの機能自体(corrplot.mixed) ''修正を見て、そこにマージンを編集することをお勧めするために自分の質問に答え

。 – CCurtis

+1

マージンを広げることはどういう意味ですか?あなたは単に 'par(oma = rep(5,4))'や..を変更することを意味しますか? – user20650

+0

@CCurtis:自分の[code](https://github.com/)で 'mar = c(0、0、0、0)'を 'mar = c(5、5、5、5) tyyun/corrplot/blob/master/R/corrplot.R)しかし、何も変わっていません。 – Tung

答えて

0
は将来の読者
library(corrplot)  
    library(viridis) 

    col4 <- viridis_pal()(dim(cor_matrix)[2]) 

    filetag <- "corrplot_result.png" 
    png(filetag, height = 800, width = 800) 

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

enter image description here

関連する問題