Added legend.framealpha to rcParams, as mentioned in axes.legend docstring#3369
Added legend.framealpha to rcParams, as mentioned in axes.legend docstring#3369tacaswell merged 3 commits intomatplotlib:masterfrom e-q:legendFrameAlpha
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
Nonewhich 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.