[R] Separate y-limits in xYplot panels II

From: John Poulsen <jpoulsen_at_zoo.ufl.edu>
Date: Tue, 08 Apr 2008 18:37:43 -0400


Hello,

I have been trying to use xYplot in Hmisc to graph plots, allowing each panel to have a y-axis dependent on the data in the panel.

Following the advice from the R-Help list, message: [R] separate y-limits in xYplot panels on Wed, 30 May 2007 08:12:06 -0700 (PDT), I used scales=list(y=list(relation="free").

However, it does not seem to work. Please see below code, where the scale of the y-axis of the 2 panels stays the same despite the scales function.

Does anyone know how to get around this?

Thanks,
John

x1=seq(1,30,0.5)
y1=x1^2
y2=10*(x1^2)

ycomb=c(y1,y2)
y.up=ycomb+0.1*ycomb
y.low=ycomb-0.1*ycomb

grp=rep(c(1,2),each=length(x1))
dat=as.data.frame(cbind(ycomb, y.up, y.low, grp, rep(x1,2))) colnames(dat)=c("ycomb","y.up","y.low","grp","x1")

with(dat, xYplot(Cbind(ycomb, y.up, y.low)~x1|factor(grp), data=dat,type="l", method="bands", scales=list(y=list(relation="free"),

        x=list(alternating=c(1,1,1)))))



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 Tue 08 Apr 2008 - 22:43:40 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 Tue 08 Apr 2008 - 23:30:28 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