代码之家  ›  专栏  ›  技术社区  ›  bashmike

R Corrplot方形(平铺)尺寸

  •  1
  • bashmike  · 技术社区  · 7 年前

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

    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))
    
    2 回复  |  直到 7 年前
        1
  •  3
  •   Marco Sandri    7 年前

    你应该调整 width height res 图形输出文件的参数。

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

    enter image description here

        2
  •  1
  •   Dr. Fabian Habersack    7 年前

    corrplot() 作用这在过去对我很有效。然后我想你应该确保选择正确的格式;例如TIFF。

    更复杂的解决方案是 this

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

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

    jpeg()
    

    干杯