hadley/ggplot2 — pull request #902 by rpruim (2014-01-31 00:35:09+00:00)
Title: adding offset argument to stat_bin()

I've added an `offset` argument to `stat_bin()` so that one can change shift the bins left or right without having to specify all the breaks. Currently, this only affects things when both `breaks` and `origin` are NULL, but one could imagine expanding the use case.

As is, it is now simple to choose a width and control the centers/edges of bins without needing to query the data and create breaks manually. For example, to get bins centered on integers, use

```r
binwidth = 1, offset=0.5
```

I have not added any examples, but the offset argument is documented in the usage section.