strange ylim behavior with facetting

4 views
Skip to first unread message

Elaine

unread,
Apr 24, 2009, 12:19:55 PM4/24/09
to ggplot2
I'm getting some very interesting behavior from ggplot when I try to
set the y axis limits when using facets. I'm using:
coord_cartesian(ylim=c(0,100))
which is my understanding of the proper way to restrict the range of y
values displayed on my plot without changing the data itself (as
opposed to ylim()). When I do this without facets, I think it works
correctly. If I add facets, however, the lines that extend beyond 100
on the y axis do not disappear, but rather continue out of their facet
into another. In other words, the limits of the y-axis in each facet
is being restricted as I want, but the data is continuing to be
shown. This is really quite interesting, but not correct. Am I using
the wrong method to specify ylim in this context, or is this a bug??



hadley wickham

unread,
Apr 27, 2009, 12:36:44 PM4/27/09
to Elaine, ggplot2
Hi Elaine,

Could you please supply a small reproducible example using a built in
dataset? That will really help me to track down the problem.

Hadley
--
http://had.co.nz/
Reply all
Reply to author
Forward
0 new messages