簡體   English   中英

R Corrplot方形(瓷磚)尺寸

[英]R Corrplot square (tile) size

我正在使用method =“number”繪制10個變量的相關圖。 我正在嘗試導出具有大字體大小(number.cex = 3,tl.cex = 3)的繪圖用於發布目的,但是方塊的大小不會增加以容納更大的字體。 有沒有辦法修改這個?

這是我的代碼,如果它有幫助:

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

您應該調整圖形輸出文件的widthheightres參數。
請參閱下面的示例。

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

在此輸入圖像描述

可能是一個非常愚蠢的想法,但根據您使用的R版本,您可以簡單地使用運行corrplot()函數時彈出的窗口進入全屏。 這在過去對我有用。 然后我想你應該確保選擇正確的格式; 例如TIFF。

當然,更復雜的解決方案就是這樣 這里的想法是在您編寫/保存圖形參數后調整圖形參數。 那有意義嗎?

通常,這個想法是這樣的(具有可互換的格式類型):

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

要么

jpeg()

您可以嘗試的包是{grDevices}或{tiff},當然還有數百個。 ;)

如果這對您有用,請告訴我。

干杯!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM