【发布时间】:2019-09-24 19:35:14
【问题描述】:
我有一个数据集,其中最低相关系数为 0.83,最高相关系数约为 0.99。我在 R 中使用包“corrplot”,并尝试使用“colorRamps”包获取色谱。我还希望频谱的最末端从我指定的上限和下限 (0.8, 1) 开始。我几乎到处都看过,但似乎找不到解决方案。我也无法加载我想要的配色方案。
我已成功使用 colorRampPalette,但我仍然无法让色谱的开始和结束在我指定的限制处开始和结束。
这是我尝试过的:
library(corrplot)
library(colorRampPalette)
library(colorRamps)
pal <- colorRamps::matlab.like2
###########Notice my cl.lim is set to 0.8-1################
corrplot(data, method = "number", type="lower", is.corr=FALSE, margin=c(0,0,0,0),col=pal, tl.col='black', cl.lim = c(0.8, 1),tl.cex=0.7, outline=TRUE, title = "9 DAT")
运行“corrplot”代码行后,我得到以下信息:
"Warning messages:
1: In text.default(pos.xlabel[, 1], pos.xlabel[, 2], newcolnames, srt = tl.srt, :
"margin" is not a graphical parameter
2: In text.default(pos.ylabel[, 1], pos.ylabel[, 2], newrownames, col = tl.col, :
"margin" is not a graphical parameter
3: In title(title, ...) : "margin" is not a graphical parameter"
我的图表也没有生成。
非常感谢您的帮助。谢谢大家!
【问题讨论】:
-
下次请添加可重现的示例。
标签: r ggplot2 colors r-corrplot