Chosid, David (FWE)
2008-Aug-05 12:37 UTC
[R] request for fine panel axis controls in lattice
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. David Chosid Massachusetts Division of Marine Fisheries 1213 Purchase St., 3rd Floor New Bedford, MA 02740 508-990-2860 x140 email: david.chosid@state.ma.us [[alternative HTML version deleted]]
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")))> David Chosid > > Massachusetts Division of Marine Fisheries > > 1213 Purchase St., 3rd Floor > > New Bedford, MA 02740 > > 508-990-2860 x140 > > email: david.chosid at state.ma.us > > [[alternative HTML version deleted]] > > ______________________________________________ > 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.-- Chuck Cleland, Ph.D. NDRI, Inc. (www.ndri.org) 71 West 23rd Street, 8th floor New York, NY 10010 tel: (212) 845-4495 (Tu, Th) tel: (732) 512-0171 (M, W, F) fax: (917) 438-0894
Hi David,>> 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).In addition to the code Chuck Cleland sent you, you may want to "square" things up by adding the argument: aspect = "iso" before the closing bracket xyplot(..., aspect="iso") Regards, Mark. DavidChosid 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. > > > > David Chosid > > Massachusetts Division of Marine Fisheries > > 1213 Purchase St., 3rd Floor > > New Bedford, MA 02740 > > 508-990-2860 x140 > > email: david.chosid at state.ma.us > > > > > > > [[alternative HTML version deleted]] > > ______________________________________________ > 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. > >-- View this message in context: http://www.nabble.com/request-for-fine-panel-axis-controls-in-lattice-tp18830204p18831668.html Sent from the R help mailing list archive at Nabble.com.