Dear Latticers, I want to position two trellis plots of different forms side-by-side. The plot types are slightly different, aspect=1 required, but panels should look the same in both plots. Current workaround uses a guessed factor. Any way to improve this?
Dieter library(lattice) n1 = 20 # I cannot rbind df1 and df2, because the x-dimensions are # different and must be scaled individually df1 = data.frame(y=rnorm(4*n1),x=rep(1:n1,4), facA=rep(c("A","B"),each=2*n1),facB=rep(c("C","D"),each=n1)) # I add a dummy facB here, to make sure panels have same structure df2 = data.frame(y=rnorm(2*n1),z=rep(100*(1:n1),2), facA=rep(c("A","B"),each=n1),facB="C") # Note: aspect = 1 is required p1 = xyplot(y~x|facA*facB,data=df1,main="Plot1",aspect=1, between=list(x=2)) p2 = xyplot(y~z|facA*facB,data=df2,main="Plot2",aspect=1,layout=c(1,2)) wi = 0.61 # this is trial-and-error print(p1,position=c(0,0,wi,1),more=T) print(p2,position=c(wi,0,1,1),more=F) ______________________________________________ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html