hadley/ggplot2 — Issue #249: geom_linerange doesn't work with coord_flip for small values
Author: wch
Created: 2011-10-29 19:02:48+00:00
State: open

I'm trying to make a Cleveland dot plot, but `geom_linerange` doesn't seem to show up when all of these are true:

* `ymax` is small, < ~.25
* the x-axis is a factor
* `coord_flip` is used

These three graphs illustrate the problem.

Factor on x-axis: OK

```
dat <- data.frame(xval=factor((1:25)/50), yval=(1:25)/50)
ggplot(dat, aes(x=xval, y=yval)) + geom_point() +
geom_linerange(aes(ymax=yval), ymin=0)
```

Factor on x-axis with coord_flip(): not OK. `geom_linerange` doesn't work for less than approximately .25

```
dat <- data.frame(xval=factor((1:25)/50), yval=(1:25)/50)
ggplot(dat, aes(x=xval, y=yval)) + geom_point() +
geom_linerange(aes(ymax=yval), ymin=0) +
coord_flip()
```

Continuous x-axis with coord_flip(): OK

```
dat <- data.frame(xval=(1:25)/50, yval=(1:25)/50)
ggplot(dat, aes(x=xval, y=yval)) + geom_point() +
geom_linerange(aes(ymax=yval), ymin=0) +
coord_flip()
```