--
You received this message because you are subscribed to the Google Groups "manipulatr" group.
To post to this group, send email to manip...@googlegroups.com.
To unsubscribe from this group, send email to manipulatr+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/manipulatr?hl=en.
> library(ggplot2)
> df1<-cbind.data.frame(x=c(0,2),y=c(1/2,1/2),Distribution="Uniform(0,2)")
> df2<-cbind.data.frame(x=c(2,5),y=c(1/3,1/3),Distribution="Uniform(2,5)")
> df <-rbind(df1,df2)
> df$Distribution<-factor(df$Distribution)
> df
x y Distribution
1 0 0.5000000 Uniform(0,2)
2 2 0.5000000 Uniform(0,2)
3 2 0.3333333 Uniform(2,5)
4 5 0.3333333 Uniform(2,5)
> print(ggplot(df,aes(x=x,y=y,group=Distribution))
+ +geom_area(aes(fill=Distribution))+ylim(0,1))
> df$x[3]=df$x[3]+0.00000001
> df
x y Distribution
1 0 0.5000000 Uniform(0,2)
2 2 0.5000000 Uniform(0,2)
3 2 0.3333333 Uniform(2,5)
4 5 0.3333333 Uniform(2,5)
> print(ggplot(df,aes(x=x,y=y,group=Distribution))
+ +geom_area(aes(fill=Distribution))+ylim(0,1))
From: manip...@googlegroups.com [mailto:manip...@googlegroups.com] On Behalf Of Dennis Murphy
Sent: Thursday, September 23, 2010 4:41 AM
To: John Ramey
Cc: manipulatr
Subject: Re: Question about ggplot2: Changing fill colors with geom_area
(Sorry for the fragmented post.)
The right polygon appears to depend on the whether
there are consecutive identical x values or not.
Could some expert please
explain?
Best regards
Dr. Martin Burschka
Sanofi-Aventis Deutschland GmbH
Industriepark
Hoechst
Bldg. H831, Room B.0436
D-65926 Frankfurt am
Main
w:www.sanofi-aventis.de
*********************************************************************************************************************************************************************
Sanofi-Aventis
Deutschland GmbH · Sitz der Gesellschaft: Frankfurt am Main ·
Handelsregister: Frankfurt am Main, Abt. B Nr. 40661
Vorsitzender des
Aufsichtsrats: Hanspeter Spek - Geschäftsführer: Dr. Martin Siewert
(Vorsitzender), Ulf Bialojahn, Dr. Matthias Braun,
Peter Guenter, Prof. Dr.
Dr. Werner Kramer, Dr. Klaus Menken, Dr. Heinz
Riederer
*********************************************************************************************************************************************************************
From: Burschka, Martin R&D/DE
Sent: Thursday, September 23, 2010 1:35 PM
To: 'Dennis Murphy'; John Ramey
Cc: manipulatr
Subject: RE: Question about ggplot2: Changing fill colors with geom_area