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

Added legend.framealpha to rcParams, as mentioned in axes.legend docstring #3369

Merged
merged 3 commits into from Sep 18, 2014
Merged

Added legend.framealpha to rcParams, as mentioned in axes.legend docstring #3369

merged 3 commits into from Sep 18, 2014

Conversation

e-q
Copy link
Contributor

@e-q e-q commented Aug 14, 2014

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 the
legend.framealpha :data:rcParam<matplotlib.rcParams>.

So, I added lines in legend.py and rcsetup.py to implement this capability.

@e-q e-q closed this Aug 14, 2014
@e-q e-q reopened this Aug 14, 2014
@tacaswell tacaswell added this to the v1.5.x milestone Aug 14, 2014
@tacaswell
Copy link
Member

Thank you for the contribution.

This will need an entry in whats_new (which is in a bit of flux right now) and to be added to the template rcparam file.

@e-q
Copy link
Contributor Author

e-q commented Aug 15, 2014

Got it, thanks. I see that the whats_new file doesn't have a v1.5 section yet, and you added this to the v1.5x milestone, so I'll hold off until that settles.

@tacaswell
Copy link
Member

The new plan for dealing with whats new is outlined in #3349 . You can go ahead an create whats_new folder and an rcparams.rst file.

@e-q e-q changed the title Added legend.framealpha to rcParams, as mentioned in axes.legend doctoring Added legend.framealpha to rcParams, as mentioned in axes.legend docstring Aug 15, 2014
@tomspur
Copy link
Contributor

tomspur commented Sep 18, 2014

I also hit this bug (where the grid was shining through the legends in my graphs), see #3462. Could this be merged please?

tacaswell added a commit that referenced this pull request Sep 18, 2014
BUG : Added legend.framealpha to rcParams, as mentioned in axes.legend docstring
@tacaswell tacaswell merged commit 04496b0 into matplotlib:master Sep 18, 2014
@tacaswell
Copy link
Member

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.

tacaswell added a commit that referenced this pull request Sep 18, 2014
BUG : Added legend.framealpha to rcParams, as mentioned in axes.legend docstring
@tacaswell
Copy link
Member

8496e06 (re-trying github-foo to make hash link...)

@e-q e-q deleted the legendFrameAlpha branch September 19, 2014 23:29
tacaswell added a commit to tacaswell/matplotlib that referenced this pull request Nov 9, 2014
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants