[R] Fixing the physical size of Trellis graphs panels

From: Sébastien <pomchip_at_free.fr>
Date: Thu, 10 Apr 2008 17:33:35 -0400


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?

Thank you for your input.

Sebastien



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 Thu 10 Apr 2008 - 21:36:34 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 Thu 10 Apr 2008 - 22: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