hadley/ggplot2 — pull request #303 by wch (2011-12-20 01:03:07+00:00)
Title: Feature/wdotplot

This is an implementation of dot plots.

I made this branch off of feature/geom-violin, so it looks like this pull request includes some of those previous commits. Hopefully this isn't a problem. I tested merging everything into the current hadley/master branch, and it seems to work.

Some things are strange because of dots are visually stacked. Notes:

* When binning along x axis, the y dimensions are arbitrary. This is because the vertical positioning of the the dots is done by the grob. I don't think it's possible to have correct y dimensions with ggplot2. (Something similar happens when binning along y axis, but the width is set so that each cluster will be dodged properly.)
* For the same reasons, the y axis label and tick labels aren't meaningful.
* When binning along x axis, pos_stack doesn't work because of the strange y dimensions. Stacking wouldn't be impossible to implement, but it would be a big hack (and it wouldn't use pos_stack).
* There is a fair bit of complexity. Part of it is because binning can be done on x or y, and part of it is because there are two methods of binning. Instead of adding the "histodot" option, I'd prefer to simply use stat_bin, but it doesn't allow binning along the y axis.

I'm going to try to implement the smoothing algorithm from Wilkinson (1999) p. 6, but I find it confusing at the moment.

Some examples here:
https://github.com/wch/ggplot2/wiki/geom_dotplot