有没有人能建议一下:
我使用corrplot来获取变量的p值。number.cex=不会改变p值的字体大小。目前,我有一个带有超大(不可读)p值的corrplot,假设我有相对较多的变量(n = 27)。
我无法通过Rseek或Stack Overflow找到有关此问题的任何信息...
下面的代码取自here。
有一些看起来过于复杂的代码here是我无法理解的。下面是我使用的代码:
corrplot(HG_lipid_matrix, p.mat = res1$p, insig = "p-value",
sig.level = .05, number.cex = 0.2)
更改number.cex的值不会更改p值的字体大小。
非常感谢:-)
发布于 2019-06-08 04:51:58
这将绘制mtcars
中变量的相关性,但这对您来说应该是有效的。您可以根据需要调整mag.factor
和par(cex = 0.7)
:
library(corrplot) #read-in corrplot package
M <- cor(mtcars) #obtain matrix of correlation coefficients (r values)
mag.factor <- 2 #fudge factor to increase size of axis (tl.cex) and legend (cl.tex) text relative to p-value text
res1 <- cor.mtest(mtcars, conf.level = .95) #obtain matrix of correlation p-values
cex.before <- par("cex") #saves current cex setting for plotting
par(cex = 0.7) #set cex for plotting text. this invisibly affects p-value text.
corrplot(M, p.mat = res1$p, insig = "p-value", sig.level = -1, tl.cex = par("cex") * mag.factor, cl.cex = par("cex") * mag.factor) #makes the plot
par(cex = cex.before) #reset cex to initial setting
它是从一个类似问题的答案修改而来的:How to change font size of the correlation coefficient in corrplot?
https://stackoverflow.com/questions/56473992
复制相似问题