On 8/5/08, Chuck Cleland <[EMAIL PROTECTED]> wrote: > On 8/5/2008 8:37 AM, Chosid, David (FWE) wrote: > > > I'm trying to use fine axis controls in lattice for each panel. > > Specifically, within each panel, I want to set the limits for x and y > > equal to each other since it is paired data (using the max value of the > > two). Of course, I have no problems setting the limits for the entire > > plot but I am having trouble setting them for each specific panel. > > Could someone please provide me some guidance? Thanks in advance. > > > > Here is an example with panel-specific limits: > > library(lattice) > > xyplot(Sepal.Length ~ Petal.Length | Species, data = iris, layout=c(3,1,1), > ylim=as.data.frame(matrix(c(1,3,4.5,5.8,7,7.9), > byrow=TRUE, nrow=2)), > xlim=as.data.frame(matrix(c(1,3,4.5,5.8,7,7.9), > byrow=TRUE, nrow=2)), > scales=list(x=list(relation="free"), > y=list(relation="free")))
A more elegant approach is to use a prepanel function: xyplot(..., scales = "free", aspect = "iso", prepanel = function(x, y, ...) { rng <- range(x, y, finite = TRUE) list(xlim = rng, ylim = rng) }) -Deepayan ______________________________________________ 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.