Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Setting `xlim` or `ylim` to values that crop data leads to a confusing warning message #2158
Comments
karawoo
added feature scales
labels
Jun 14, 2017
|
Setting limits on a scale changes the underlying data and replaces values outside the limits with NAs, hence that message. These are then treated the same as any NAs in the original data, so it may not be easy to tell which NAs were always there and which were introduced by setting the limits, but I can look into it. Another option that produces the same plot with no warning is: ggplot(a, aes(x = x, y = y)) +
geom_point() +
coord_cartesian(xlim = c(0, 2), ylim = c(0, 2))But I agree that the message is confusing to beginners, who are also probably more likely to know about |
MilesMcBain commentedJun 14, 2017
If data lie outside the bounds set by
xlimandylimthe warning issued is:This was misinterpreted by a beginner I was helping as an assertion that there were missing data in their dataframe. I think we can make the message more specific in this case, something like:
A reprex: