-
Notifications
You must be signed in to change notification settings - Fork 2.1k
geom_hline: inherit.aes is always FALSE #426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I think the best solution is to split |
Could we just use ggplot(mtcars, aes(x=disp, y=mpg, colour=factor(cyl))) + geom_point() +
annotate("hline", yintercept=20)
# Error in is.unit(y1) : object 'yend' not found I think it has something to do with |
Yes, but I think it needs some re-writing of the |
Here is another issue which comes about because Consider:
The first works as expected. The second gives
The third gives
The forth works. The pattern is identical for
It is worth noting that using
This comment was inspired by the StackOverflow question http://stackoverflow.com/q/18786161/892313 |
This sounds like a great feature, but unfortunately we don't currently have the development bandwidth to support it. If you'd like to submit a pull request that implements this feature, please follow the instructions in the development vignette. |
- These geoms still have same type of issues as ggplot2. tidyverse/ggplot2#426 This is a badge-of-honor :)
For
geom_hline
,vline
, andabline
,inherit.aes
is always FALSE. I can see an advantage: when drawing data from a different data frame, it won't attempt to map possibly nonexistent variables tox
andy
. However, there are a few drawbacks:colour
andyintercept
can't be inherited and must be respecified for the geom. This is especially strange if the values are drawn from the original data frame.It appears impossible to set
inherit.aes=TRUE
. I think this is because the value is hard-coded in the$new
functions for each geom. If it is indeed desired to have them not inherit by default, I think a better way is to set the default valueinherit.aes=FALSE
, instead of hard-coding it.The text was updated successfully, but these errors were encountered: