Playing with alpha and with different colors doesn't seem to solve the
problem.
Here's an example
x<-c(24,55,69,73)
y<-c(44,56,12,90)
z<-c(1,2,3,4)
a<-data.frame(pos=z, y=y, x=x)
ex<- ggplot(data=a, aes(pos)) +
geom_area(aes(y = y),size=.1, fill="navyblue", alpha = 0.7,
position="identity") +
geom_area(aes(y = x), size=.1, 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?
Thanks,
Squid.
On Nov 23, 5:54 pm, hadley wickham <h.wick...@gmail.com> wrote:
> And you'll probably want to override the default stacking behaviour with:
>
> p + geom_area(alpha = 0.5, position = "identity")
>
> Hadley
>
> On Mon, Nov 23, 2009 at 11:53 AM, Luciano Selzer
>
>
>
> <luciano.sel...@gmail.com> wrote:
> > Hi Squid, you could call the geom_area with the alpha option in it
> > something like:
>
> > p+geom_area(alpha=0.5)
>
> > Luciano
>
> > 2009/11/23 squid <bluecuttlef...@gmail.com>:
This is related to the colour blending model that R uses. I remember
reading about something that explains this at some point in the past,
but I can't find anything with some searching today.
Hadley
This works really well but I'm wondering if it is possible to have the
"expected" color in areas of overlap.
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
problem.
Here's an example
x<-c(24,55,69,73)
y<-c(44,56,12,90)
z<-c(1,2,3,4)
a<-data.frame(pos=z, y=y, x=x)
ex<- ggplot(data=a, aes(pos)) +
geom_area(aes(y = y),size=.1, fill="navyblue", alpha = 0.7,
position="identity") +
geom_area(aes(y = x), size=.1, 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?
Thanks,
Squid.
On Dec 17 2009, 4:02 pm, hadley wickham <h.wick...@gmail.com> wrote:
> On Thu, Dec 17, 2009 at 3:26 PM, squid <bluecuttlef...@gmail.com> wrote:
> > This works really well but I'm wondering if it is possible to have the
> > "expected"colorin areas of overlap.
http://www.mail-archive.com/r-h...@r-project.org/index.html#83970
as far as I can make out, there is little one can do to change the
colour mixing behavior in R. It may be that a specific device could be
made to use a different mixing rule ( tikzDevice comes to mind for its
editable output format ) but I'm not sure how.
Best,
baptiste