Hi Jiho, To figure this out, you need to think about exactly what you are doing when you change the limits - what part of the plot are you changing? You are changing the scales, and if you have a look at http://had.co.nz/ggplot2/scale_continuous.html, you'll see you need something like:
+ scale_y_continuous(limits=c(0,10) Remember, you can also modify qplot in the same way as ggplot: qplot(...) + geom_point() + ... Regards, Hadley On 9/20/07, jiho <[EMAIL PROTECTED]> wrote: > Hello everyone, > > I am (happily) using ggplot2 for all my plotting now and I wondered > is there is an easy way to specify xlim and ylim somewhere when using > the ggplot syntax, as opposed to the qplot syntax. Eg. > > qplot(data=mtcars,y=wt, x=qsec,xlim=c(0,30)) > > <-> > > ggplot(mtcars, aes(y=wt, x=qsec)) + geom_point() + ??? > > Indeed the ggplot syntax is in general more flexible and powerful and > I usually rely on it in scripts. It would be nice to know how to use > xlim/ylim with this syntax. > > Thank you in advance. > > JiHO > --- > http://jo.irisson.free.fr/ > > ______________________________________________ > 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. > -- 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.