[R] ggplot scale limit and stat_smooth

hadley wickham h.wickham at gmail.com
Wed Oct 22 04:29:28 CEST 2008


Hi Eric,

> 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've added that back in the next version as limits on the coordinate
system. This is consistent with other behaviour: scales affect things
before statistics and coordinate systems affect things afterwards.
All going well, I'm aiming for a new release in early November.

Hadley



-- 
http://had.co.nz/



More information about the R-help mailing list