[R] color blending and transparency
jim at bitwrit.com.au
Wed Feb 3 11:15:01 CET 2010
On 02/03/2010 08:43 PM, bluecuttlefish wrote:
> I am using ggplot and posted this question at that helplist. It was
> suggested that I try a more general R-help list for a possible solution to
> this problem.
> Within ggplot, I am using geom_area with red and blue and expect where they
> overlap should be purple. But instead, it's dark red.
> Playing with alpha and with different colors doesn't seem to solve the
> Here's a very simple reproducible example
> R --arch x86_64
> a<-data.frame(pos=z, y=y, x=x)
> ex<- ggplot(data=a, aes(pos)) +
> geom_area(aes(y = y),fill="navyblue", alpha = 0.7, position="identity") +
> geom_area(aes(y = x), fill= "darkred", alpha = 0.7,position="identity" ) +
> opts(panel.background = theme_rect(fill = "white"))
> Likewise, with blue and yellow, I would expect overlap to be green.
> Are there any solutions to this that would allow color overlaps to lead to
> the "expected" color?
Think ink - should be easy. Only certain devices support transparency.
Have you tried this on the pdf device?
More information about the R-help