I'm plotting a lattice bwplot from a data.frame and would like to add some horizontal lines indicating some reference values (preferably with text annotation) as well as a grid of regular log tics. The following illustrates the plot: data(ToothGrowth) require("lattice") p = bwplot(exp(len) ~ supp, ToothGrowth, panel = function(..., box.ratio) { panel.grid(h=-1, col.line="grey") panel.violin(..., col = "lightblue", adjust = 1.0, varwidth = FALSE, box.ratio = box.ratio, log = 'y') panel.bwplot(..., fill = NULL, box.ratio = .1, log = 'y') }, scales=list(y=list(log=TRUE)))
(The actual data I am working with represents bandwidth achieved in a set of tests at times and a log scale seems appropriate. Also there are many tests). I've tried the following to add horizontal lines with no success. I get no abline at all and just two evenly spaced grid lines. panel.abline(h=10^13, col.line="red") panel.grid(h=2, v=0, y=c(10^11, 10^12), col.line="blue") Also I have no idea where to start annotating the lines (well panel.text seems the place to start). FWIW I tried ggplot2 also, but the violins it produces for my data get lost in the scale I need as the distributions for some tests are much narrower than for others (and far from normal). Gareth Williams CSIRO ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.