-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Use alpha for lines of geom_density(), geom_bar(), and so on #1371
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
It was a deliberate design decision. But now I can't remember why 😦 I think I had a good reason though. |
Hmm..., thanks for your quick answer, anyway. I found the behavior of Okay, I trust in you this time. You always have a good reason; the very fact can be a good reason for me to close this issue 👍. Please close this issue anytime! But, I hope you will occasionally remember that not a few people are confused at this. At least, this should be included in ggplot2 book. |
You're right - it's more consistent to affect both. Done! |
Wow!!! Thanks for your decision! You are always great 👍 |
I am so sorry to see this! You should believe in yourself more hadley :-).
While if you wanted to get the line lighter, you can always change its Could we revert this? I'm pretty sure it's breaking more code now than it would if reverted for 2.1... |
@antoine-lizee can you please file a new issue? I'm likely to lose track of an old issue with a comment. |
Of course. #1523 |
Hi, thanks for this great package!
I saw many people (including me) are confused at the behavior of
alpha
when used in Geoms which draw areas or rects (e.g.geom_desity()
). So, let me ask if this is your design decision or not.When I draw a chart with
alpha
, I expect that the whole layer, the line and fill, will become transparent. But the line stays clear red.I expect the one like this.
I know we can draw the latter chart by using
colour=alpha("red", 0.1)
, but I believealpha
is a transparency param for the entire layer, not only for the line or the fill. For me, this is a matter of semantics. Are there any reason not to usealpha
forcolour
?The possible implementation is very simple. We just need to change those two lines to
col = alpha(aes$colour, aes$alpha)
:https://github.com/hadley/ggplot2/blob/bbc1b5ad3c0f55e8809d4fe1a9bd2783eb9fa29c/R/geom-rect.r#L55
https://github.com/hadley/ggplot2/blob/bbc1b5ad3c0f55e8809d4fe1a9bd2783eb9fa29c/R/geom-ribbon.r#L95
If this looks good to you, I'm happy to submit PR 😄
The text was updated successfully, but these errors were encountered: