Is there a way to use coord_cartesian to set the lower y limit to 0, but continue the automatic setting for ymax?
I have a large set with multiple groups and categories. I want them each group to display on it's own page with facets for every category, so I am content with the automatic upper-bounds.
I am making qq plots, and because of skewed data, the normal distribution (from stat_qq_line) goes into the negative. Simply setting ymin would limit stat_qq_line, so I want to use coord_cartesian instead.
I was hoping
coord_cartesian(ylim = c(0, NA))
would work, but it produces
Error in if (zero_range(range)) zero_width else diff(range) :
missing value where TRUE/FALSE needed
Entire block if that helps:
p <- ggplot(dsub2, mapping = aes(sample = Usual)) +
stat_qq_line() + stat_qq_point() +
facet_wrap(~Category, scales = "free", labeller=labeller(Category = labels)) +
labs(title=paste("Group", group),
x = "Theoretical Quantiles", y = "Sample Quantiles") +
theme(plot.title = element_text(hjust = 0.5)) +
coord_cartesian(ylim = c(0, NA))