Skip to content
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

fix: Alpha respected by polygon lines #385

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

TyberiusPrime
Copy link
Contributor

Many geoms only partially support alpha in the sense that their borders are always at alpha=1.

This fixes this for anything using geom_polygon plus geom_boxplot.

Example:
image

This is a 'minimal' change that makes alpha work on both the fill and the lines.
Doing it this way gives the user the option to draw the lines at alpha = 1 by repeating the geom with fill=None, increasing the number of possible plots.

The other option would have been to introduce 'color_alpha' at every geom where you'd consider it (since the color comes from... color ;)).

ggplot2 bug tracker suggests they fixed alpha to affect both at one point: tidyverse/ggplot2#1371 but this seems to have regressed?

Anyhow, this patch enables me to draw graphs like this (note the subtle glow):
image

@has2k1
Copy link
Owner

has2k1 commented Apr 17, 2020

I kind of recall the reason for this being mentioned in one of the ggplot2 google groups. This was a long while back.

@TyberiusPrime
Copy link
Contributor Author

I agree that the clean way would be to have two mappings.
But either way it means we must deviate from the ggplot API a bit. Now I believe additions are ok...

@TyberiusPrime
Copy link
Contributor Author

I'm willing to change the implementation to two mappings. Just tell me what to call it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants