Alpha channel in ggplot2 does not work after installing 2.15

After upgrading to R 2.15, the alpha channel in ggplot no longer works.

plot(rnorm(100),rnorm(100),bg="#cc000055",pch=21) 

works fine but

 qplot(rnorm(100),rnorm(100),color="#cc000044") 

not! Also, the alpha () function from the ggplot2 package is no longer found (I also tried ggplot2 :: alpha ().

Is this a known issue? I could not find anything on the Internet ...

Thanks!

+6
source share
2 answers

I can replicate the problem using R-2.15.0 and ggplot2 0.9.0.

As Ben noted, the standard way to set transparency in ggplot2 is to provide an explicit alpha argument. You should try to use this for all new build code.

I think that the case may lead to ggplot supporting the legacy alpha specification through the color argument. If you are determined to do so, write about the problem .

+4
source

This is indicated in the comments above, but if you are working with some old ggplot code, and R gives an error message after calling alpha() , you need to explicitly load library(scales) into R.

+1
source

Source: https://habr.com/ru/post/912645/


All Articles