-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Added legend.framealpha to rcParams, as mentioned in axes.legend docstring #3369
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
Conversation
Thank you for the contribution. This will need an entry in |
Got it, thanks. I see that the |
The new plan for dealing with whats new is outlined in #3349 . You can go ahead an create |
I also hit this bug (where the grid was shining through the legends in my graphs), see #3462. Could this be merged please? |
BUG : Added legend.framealpha to rcParams, as mentioned in axes.legend docstring
Decided to cherry-pick this back to 1.4.x sans the whatsnew entry as 8496e06 as I had not fully grasped that this was in fact documented behaviour that never got implemented, not a 'new' feature. |
BUG : Added legend.framealpha to rcParams, as mentioned in axes.legend docstring
8496e06 (re-trying github-foo to make hash link...) |
Fixes matplotlib#3766 Adding `legend.framealpha` in matplotlib#3369 changed the default value of alpha on the legend patch from `None` -> 1 which has no visual effect as `to_rgba` defaults to alpha=1 if no alpha is passed, but this overrides setting the alpha component via `set_facecolor(rgba_value)`. This PR - addes a new validation function `validate_float_or_None` - changes legend.framealpha to default to `None` - adds test that with the default value of `legend.framealpha` the alpha value of the face can be set via a rgba value - adds tests that setting the framealpha to a non-None value ignores the alpha value passed to set_facecolor
I like having translucent legend frames. In _axes.py, I saw:
framealpha : None or float
Control the alpha transparency of the legend's frame.
Default is
None
which will take the value from thelegend.framealpha
:data:rcParam<matplotlib.rcParams>
.So, I added lines in legend.py and rcsetup.py to implement this capability.