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
Adding geom_hline with boolean logic in facet_wrap causes failure #2091
Comments
|
Try this |
billdenney
commented
Mar 29, 2017
|
library(ggplot2)
d <- data.frame(X=rnorm(10),
Y=rnorm(10),
Z=rnorm(10))
ggplot(d, aes(x=X, y=Y)) +
geom_point() +
facet_wrap(~(Z < 0.5))
# Plot appears as expected
ggplot(d, aes(x=X, y=Y)) +
geom_point() +
facet_wrap(~(Z < 0.5)) +
geom_hline(yintercept=0, inherit.aes=TRUE)
# Warning: Ignoring unknown parameters: inherit.aes
# Error in eval(expr, envir, enclos) : object 'Z' not found |
|
What about this |
billdenney
commented
Mar 30, 2017
|
If possible, it would be nice to have |
billdenney commentedMar 29, 2017
When I have logic in the equation for facet_wrap (like
facet_wrap(~(Z < 0.5))), it works fine without a geom_hline modifier, but with the modifier, it gets an error that "object 'Z' not found.