Re: [R] xyplot and separate abline per plot

From: Sébastien Bihorel <sbihorel_at_buffalo.edu>
Date: Fri, 27 Jun 2008 10:23:50 -0400

Hi Karin,

Try this

xyplot(numbers~sqrt(breaks)|moltype+disttype, groups = type,
data = alldata,

panel = function(x, y, ...){
panel.abline(h = 0, col.line = 1)
panel.xyplot(x, y, ...,
pch = 1,
col.symbol = 1)})

Look at panel.abline in the lattice help for more details. Here, "h = 0" will plot a horizontal line at y = 0 in each of your panels. Similarly, "v = 0" will plot a vertical line at x = 0 in each of your panels. You will need to build a vector to plots these lines at different coordinates.

Sebastien



R-help_at_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. Received on Fri 27 Jun 2008 - 15:06:58 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 27 Jun 2008 - 15:31:49 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive