本文介绍了如何更改Corrplot中相关系数的字体大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用corrplot绘制相关图.我还要绘制相关系数:

I am plotting correlation plot with corrplot. I want to plot also the correlation coefficients:

require(corrplot)
test <- matrix(data = rnorm(400), nrow=20, ncol=20)
corrplot(cor(test), method = "color", addCoef.col="grey", order = "AOE")

但是它们在情节中太大了:

But they are too big in the plot:

有什么方法可以减小系数的字体?我一直在查看?corrplot,但是只有参数可以更改图例和轴字体大小(cl.cextl.cex). pch.cex也不起作用.

Is there any way to make the font of the coefficent smaller? I've been looking at ?corrplot but there are only parameters to change the legend and axis font sizes (cl.cex and tl.cex). pch.cex doesn't work either.

推荐答案

距离答案还很遥远,虽然有点脏,但这行得通(感谢user20650的想法):

It is far from the answer, it is kind of a dirty hack, but this works (thanks user20650 for the idea):

cex.before <- par("cex")
par(cex = 0.7)
corrplot(cor(envV), p.mat = cor1[[1]], insig = "blank", method = "color",
    addCoef.col="grey",
    order = "AOE", tl.cex = 1/par("cex"),
    cl.cex = 1/par("cex"), addCoefasPercent = TRUE)
par(cex = cex.before)

这篇关于如何更改Corrplot中相关系数的字体大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 21:00