Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在R中更改corrplot的透明度?_R_R Corrplot - Fatal编程技术网

如何在R中更改corrplot的透明度?

如何在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自行设置颜色及其透明度:

我在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
自行设置颜色及其透明度:

library(scales)

colors <- scales::alpha(colorRampPalette(c("white", "red"))(10), alpha = 0.3)

corrplot::corrplot(cor0, "square", col = colors)
库(比例)
颜色