2016-08-19 19 views
2

我無法找到任何選項來擴大由corrplot包中corrplot.mixed生成的圖的邊距。任何建議,將不勝感激!如何更改相關矩陣圖的邊距

  • 我的數據:

    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

你是什麼意思擴大利潤率?你的意思只是改變是重新考慮(oma = rep(5,4))'還是...? – user20650

+0

@CCurtis:我在他們的[代碼](https://github.com/)中將他們的'mar = c(0,0,0,0)'修改爲'mar = c(5,5,5,5)' taiyun/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