简体   繁体   English

R corrplot颜色范围

[英]R corrplot colors range

I am using corrplot in R to plot a correlation-coefficient matrix, but my correlations range only from 0.95 to 1.00, and I don't know how to set the lower and upper bounds of colors palette. 我在R中使用corrplot绘制了一个相关系数矩阵,但是我的相关范围仅从0.95到1.00,并且我不知道如何设置调色板的上下限。

corrplot(segCorr, order = "hclust", tl.cex = .6, 
         cl.lim = c(0.95, 1), col=colorRampPalette(c("blue","white","red"))(10))

Despite of the settings everything is in one color, but I need to see these small differences in details. 尽管进行了设置,但是所有内容都是一种颜色,但是我需要在细节上看到这些细微的差别。

A "hack" I sometimes use, to avoid spending too much time setting a good color-pallete, is to set is.corr = FALSE . 我有时会使用is.corr = FALSE来避免设置过多的颜色,这是我的“ hack”。 Then we get from 然后我们从

with(mtcars, corrplot(cor(cbind(disp, hp, cyl)), cl.lim = c(0.7, 1)))

在此处输入图片说明

to... 至...

with(mtcars, corrplot(cor(cbind(disp, hp, cyl)), cl.lim = c(0.7, 1), is.corr = FALSE))

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM