hadley/ggplot2 — pull request #993 by noamross (2014-08-06 02:46:43+00:00)
Title: New theme option to put panel/grid on top of data

A new theme option, `panel.ontop`, places the background objects (panel, gridlines), on *top* of the
data in the plot if set to `TRUE`. This allows one to place gridlines over the data. One would typically also include a blank or transparent panel in the theme.

This is implemented by changes in facet_panels.* functions, changing the ordering of layers depending on the value of `theme$panel.ontop`. `add_theme` was also changed to allow for logical theme elements.

This is a simple implementation. A more advanced one would allow gridlines to be placed on top of data while keeping the panel below data.

Updated `theme()` documentation included via roxygen 4.0.1.

Tests passed with the following exception. which I believe is unrelated:

```
Stats : .Error in predLoess(y, x, newx, s, weights, pars$robust, pars$span, pars$degree, :
NA/NaN/Inf in foreign function call (arg 5)
In addition: Warning message:
In max(panels$ROW) : no non-missing arguments to max; returning -Inf
```

Fixes #551