[R] accessing ylim set by xyplot
Peter Dalgaard
P.Dalgaard at biostat.ku.dk
Fri Oct 12 14:57:56 CEST 2007
Powell, Jeff wrote:
> Hello,
>
> I would like to know if there is a clever way to avoid the problem
> illustrated below within the xyplot function.
>
> x <- seq(1:10)
> y <- seq(1:10)
> pr1 <- xyplot(x ~ y)
>
> u <- seq(1:12)
> v <- seq(1:12)
> pr2 <- xyplot(u ~ v, col = "red", more = FALSE)
>
> prts <- list(pr1, pr2)
>
> for(i in prts) print(i, more = TRUE)
>
>
>
Here's half a solution:
> r <- range(sapply(prts,"[[","y.limits"))
> for(i in prts) {i$y.limits<-r; print(i, more = TRUE)}
--
O__ ---- Peter Dalgaard Øster Farimagsgade 5, Entr.B
c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
More information about the R-help
mailing list