如何在R中更改corrplot的透明度?
我在R工作,正在使用库如何在R中更改corrplot的透明度?,r,r-corrplot,R,R Corrplot,我在R工作,正在使用库corrplot 我想更改corrplot的透明度,类似于在ggplot中控制alpha参数 我正在使用的代码示例如下: x <- rnorm(100,0,1) y <- rnorm(100,0,1) z <- rnorm(100,0,1) cor0 <- cor(cbind(x,y,z)) corrplot::corrplot(cor0, "square") x一种可能是使用scales::alpha自行设置颜色及其透明度:
corrplot
我想更改corrplot
的透明度,类似于在ggplot
中控制alpha
参数
我正在使用的代码示例如下:
x <- rnorm(100,0,1)
y <- rnorm(100,0,1)
z <- rnorm(100,0,1)
cor0 <- cor(cbind(x,y,z))
corrplot::corrplot(cor0, "square")
x一种可能是使用scales::alpha
自行设置颜色及其透明度:
library(scales)
colors <- scales::alpha(colorRampPalette(c("white", "red"))(10), alpha = 0.3)
corrplot::corrplot(cor0, "square", col = colors)
库(比例)
颜色