On 4/10/08, Sébastien <[EMAIL PROTECTED]> wrote:
> Dear R-users,
>
>  Please consider the following script:
>
>  #####
>
>  library(lattice)
>  ID <- rep(1:8,each=2)
>  x <- rep (c(1,2),8)
>  y <- c(rep(c(0.5,2),4),rep(c(50,1000),4))
>  df<-data.frame(ID,x,y)
>  g <- rep(1:2,each=8)
>  df.split<-split(df,g)
>
>  df.split
>
>  pdf(file="C:/Test.pdf")
>
>  for (i in 1:2) {
>  mydf<-as.data.frame(df.split[i])
>  myplot<-xyplot(mydf[,3]~mydf[,2]|mydf[,1],
>        data=mydf,
>        layout=c(2,2))
>  print(myplot)
>  }
>  dev.off()
>
>  You will find that the physical size of the panels are different on page
>  1 and 2 because the axis labels have different length. Is it possible to
>  fix the dimension of the panels regardless of the length of the axis labels?

Yes, look at the entry for panel.width and panel.height in
?print.trellis. You could use it as

print(myplot, panel.width = list(x = 3, unit = "inches"))

etc. See ?unit in the grid package for details.

-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.

Reply via email to