This question is similar to this one: How to set limits for axes in ggplot2 R plots?, with the difference that I want to limit one side only (e.g. plot only for x>0 instead of -5000 < x < 5000 )
and do it with facets
.
Note, I'd like to know solutions for both of these simple cases:
scale_x_continuous(limits = c(-5000, 5000))
( the same asxlim(-5000, 5000)
) - it removes points entirely from consideration (e.g. they will not be used forgeom_smooth())
coord_cartesian(xlim = c(-5000, 5000))
functions - it simply does not plot them (but still uses forgeom_smooth())
This situation happens often when you use facet_wrap(~veg, scales = "free_x)
and don't know what the upper x limit for each facet, but you know that they are always positive.