7

This answer describes how to change the y limits of a plot in ggplot. Suppose I have a faceted plot with a different ylim for each facet, e.g.

facet_wrap(~some_facet, scales="free_y")

How can I change the y limits for each facet differently?

Community
  • 1
  • 1
dfrankow
  • 20,191
  • 41
  • 152
  • 214
  • 1
    Do you need to increase the limits or decrease them? (There is no clean way to do this.) – joran Feb 02 '15 at 16:43
  • 1
    http://stackoverflow.com/questions/12207419/r-how-do-i-use-coord-cartesian-on-facet-grid-with-free-ranging-axis might help – user20650 Feb 02 '15 at 19:28
  • @joran My use case was trying to exclude any negative numbers, since I know all the counts are positive, but adding geom_smooth() using loess added massive error bars into the negative. – dfrankow Feb 04 '15 at 07:07
  • @user20650 Thanks for the ref. That may be the right thing, but I'm not going to reach into the grobs for now. I ended up just restricting the X axis so it didn't reach the point where the error bars go largely negative. – dfrankow Feb 04 '15 at 07:08

0 Answers0