[R] ggplot2 barplot: extra markers in graph

Dieter Vanderelst dieter_vanderelst at emailengine.org
Wed Aug 4 15:53:51 CEST 2010


Thanks, this indeed solved the problem.

Regards,
Dieter

On 4/08/2010 15:21, Shentu wrote:
> 
> 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.
> 
>



More information about the R-help mailing list