On Tue, Sep 18, 2012 at 10:46 PM, David Morrison <
da...@bnl.gov> wrote:
> I recently plotted some data using geom_pointrange and was surprised at how
> that geom behaved when I set limits on the scale. This code should
> illustrate things:
>
> d<-data.frame(x=c(1,2),y=c(0.01,0))
> p<-ggplot(d)+geom_pointrange(aes(x=x,y=y,ymin=y-0.1,ymax=y+0.1))+scale_y_continuous(limits=c(-0.095,0.11))
> print(p)
>
> The limits on the scale are such that they clip the ymin of the second data
> point. I had figured I would end up with an error bar extending to the
> lower edge of the plot. Failing that, I figured the geom for that data
> point would be removed entirely from the plot. What I got was surprisingly
> in between those two extremes. The error bar was gone but the central value
> was plotted. In my case, this led to several minutes of confusion as I
> tried to figure out what was going on.