[R] how to add a vertical line for each panel in a lattice dotplot with log scale?
maxbre
mbressan at arpa.veneto.it
Thu Jun 7 14:37:34 CEST 2012
...and what if I need to plot another vertical line for showing also the
means for each panel?
by simply adding another call to panel.abline () seems not producing a
correct result for each panel
# medians and means for each panel:
dotplot(variety ~ yield | site, data = barley,
scales=list(x=list(log=TRUE)),
layout = c(1,6),
panel = function(x,y,...) {
panel.dotplot(x,y,...)
median.values <- median(x)
panel.abline(v=median.values, col.line="red")
mean.values <- mean(x)
panel.abline(v=mean.values, col.line="red")
})
In the dataset I'm currently working on (which is not the above mentioned
example) I've got a wrong plottting of the means for each panel, what I'm
missing?
thanks
--
View this message in context: http://r.789695.n4.nabble.com/how-to-add-a-vertical-line-for-each-panel-in-a-lattice-dotplot-with-log-scale-tp4632513p4632678.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list