I am intrigued why bxp does not support panel.first in order to draw a grid
behind the boxplots. The advice given here:
https://stat.ethz.ch/pipermail/r-help/2006-April/104608.html
seems utterly bogus, and the result is noticeably different in PDF.
I would propose the following patch, which follows what is done for
plot.default. If it is ok, I can produce also patches for the documentation.
Please apply to:
https://svn.r-project.org/R/trunk/src/library/graphics/R/boxplot.R
Cheers,
Manuel.
--- boxplot.R 2011-12-02 14:22:10.000000000 +0100
+++ boxplot-grid.R 2012-01-30 18:19:18.400445423 +0100
@@ -108,7 +108,8 @@
bxp <- function(z, notch=FALSE, width=NULL, varwidth=FALSE, outline = TRUE,
notch.frac = 0.5, log = "", border=par("fg"),
pars = NULL, frame.plot = axes, horizontal = FALSE,
- add = FALSE, at = NULL, show.names = NULL, ...)
+ add = FALSE, at = NULL, show.names = NULL,
+ panel.first = NULL, ...)
{
pars <- c(list(...), pars)
## this could give duplicates, so ensure first mentioned wins.
@@ -219,6 +220,7 @@
plot.window(ylim = xlim, xlim = ylim, log = log, xaxs = pars$yaxs)
else
plot.window(xlim = xlim, ylim = ylim, log = log, yaxs = pars$yaxs)
+ panel.first
}
xlog <- (par("ylog") && horizontal) || (par("xlog") && !horizontal)
______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel