[R] ggplot2 barplot: extra markers in graph

Shentu yue_shentu at merck.com
Wed Aug 4 15:21:04 CEST 2010


The reason you see the exra markers is that the first part of the command
"qplot(DT$N,DT$D,fill=factor(DT$C))" already plots the individual points.
You didn't see it with "geom_bar(stat = "identity")" simply because the
stacked bars made the previous layer invisible. To see this you can use the
ggplot function to reproduce your graph (with the points):

p<-ggplot(data=DT,aes(x=N,y=D))+geom_point()+geom_bar(stat="identity",aes(fill=factor(C)),position="dodge")

print(p)

It then becomes obvious that once you omit the geom_point(), the points are
gone. 

This is IMO a feature of the ggplot2 system, not necessarily a bug.


-- 
View this message in context: http://r.789695.n4.nabble.com/ggplot2-barplot-extra-markers-in-graph-tp2313337p2313426.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list