On Mon, Nov 17, 2008 at 3:49 PM, Etches Jacob <[EMAIL PROTECTED]> wrote: > In lattice > > #toy data > library(ggplot2) > library(lattice) > x <- rnorm(100) > y <- rnorm(100) > k <- sample(c("Weak","Strong"),100,replace=T) > j <- sample(c("Tall","Short"),100,replace=T) > w <- data.frame(x,y,j,k) > > xyplot(y~x|j+k,scales=list(y=list(relation="free"))) > > will give you a scale in each subplot with a range equal to the range of y > within each subplot. > > Is this possible using ggplot2? > > qplot(x,y,data=w) + facet_grid(j~k) + ylim(-2,2) > > produces a plot with the same range in each subplot. Can the lattice > behaviour be reproduced in ggplot2?
Not yet, but in the next version (to be released within the week), you'll be able to do: qplot(x,y,data=w) + facet_grid(j~k, scales = "free_y") + ylim(-2,2) Hadley -- http://had.co.nz/ ______________________________________________ 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.