[R] ggplot scale limit and stat_smooth

rmailbox at justemail.net rmailbox at justemail.net
Wed Oct 22 04:03:43 CEST 2008



In the change log of ggplot2, version 0.7, I find this:

"* scales: any point outside of limits is dropped (this was previously the
 behaviour for discrete scales, but not continuous scales)"

and that makes sense for some applications. But what about if I
want to summarize the data with a smooth, and (a) include the
effect of all values, but (b) "zoom in" on the smooth by
adjusting the scales?  Is this still possible? If I set the limit
with scale_y_continuous(lim = c(0, whatever) ) , the effect of
points in the original data outside of the y range on the scale
has clearly been removed from the smooth. I do not want
that. I just want to be better able to see the differences
between two smooth lines without the scale limits being set to
accommodate every single extreme point.

I am using R 2.7.2 on Windows with ggplot2 0.7.

Thanks,
Eric



More information about the R-help mailing list