Hi John,
I think even with scales=list(y=list(relation="free") you have to
specify the y-limits for each panel, i.e. add something like
ylim=list(c(0,1200),c(0,10000)) to your code.
Best regards,
Christoph
Wednesday, April 9, 2008, 12:37:43 AM, you wrote:
> 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.
***************************************************************
Dr. Christoph Meyer
Institute of Experimental Ecology
University of Ulm
Albert-Einstein-Allee 11
D-89069 Ulm
Germany
Phone: ++49-(0)731-502-2675
Fax: ++49-(0)731-502-2683
Mobile: ++49-(0)1577-156-7049
E-mail: christoph.meyer at uni-ulm.de
http://www.uni-ulm.de/nawi/nawi-bio3.html
***************************************************************
==============End of original message text==========
***************************************************************
Dr. Christoph Meyer
Institute of Experimental Ecology
University of Ulm
Albert-Einstein-Allee 11
D-89069 Ulm
Germany
Phone: ++49-(0)731-502-2675
Fax: ++49-(0)731-502-2683
Mobile: ++49-(0)1577-156-7049
E-mail: christoph.meyer at uni-ulm.de
http://www.uni-ulm.de/nawi/nawi-bio3.html