after updating to R 2.15, the alpha channel in ggplot does not seem to work anymore.
plot(rnorm(100),rnorm(100),bg="#cc000055",pch=21)
works perfectly fine but
qplot(rnorm(100),rnorm(100),color="#cc000044")
does not! Also, the alpha() function from the ggplot2 package is not found anymore (I also tried ggplot2::alpha().
Is that a known problem? I wasn't able to find anything about online...
Thanks!
I can replicate the issue using R-2.15.0 and ggplot2 0.9.0.
As Ben noted, the standard way of specifying translucency in ggplot2 is to provide an explicit alpha
argument. You should try to use this for all new plotting code.
I think a case could made that ggplot should support legacy specification of alpha via the colour argument. If you feel strongly about this, then file an issue.
This is referenced in the comments above, but if you are working with some old ggplot code and R throws an error after a call to alpha()
you need to explicitly load library(scales)
into your R environment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With