Re: [R] Setting scales for ggplot2 with facets

2010-09-12 Thread Sven Laur
Sorry, I was too vague in my initial question. To make it clearer I included the following example: tmp <- data.frame(y=runif(10), x=gl(2,5), class=gl(2,5)) p <- ggplot(data = tmp) p <- p + geom_point(aes(y=y, x=x)) p <- p + facet_wrap(~ class, scales = "free") p <- p + ylim(0, 1) p This code

Re: [R] Setting scales for ggplot2 with facets

2010-09-11 Thread Sven Laur
uld I do it? On 11 Sep 2010, at 23:37, Jonathan Christensen wrote: > Swen, > > facet_grid forces the scale for plots along an axis to be shared. > Try facet_wrap instead. > > Jonathan > > > On Sat, Sep 11, 2010 at 2:21 PM, Sven Laur wrote: > Faceting in ggpl

[R] Setting scales for ggplot2 with facets

2010-09-11 Thread Sven Laur
Faceting in ggplot2 seems to permit different scales for different facets, but I fail to see how one could control ylim and xlim ranges for each facet separately. For instance, I would like to set the ylim = c(0,10) for facet "A" and ylim = c(42,102) for facet "B". Since the data is out of th

[R] Problem with S4 generic function print

2010-01-11 Thread Sven Laur
. It seems bizarre... System is Mac OS X 10.5.8 (PowerPC) R 2.9.1 GUI 1.28 Tiger build 32-bit (5444) R version 2.9.1 (2009-06-26) Minimal amount of code to get the behaviour is if(!isGeneric("print")) {setGeneric("print",useAsDefault=print)} What is the