Skip to content

BUG : correct default value alpha on legend patch - #3773

Merged
jenshnielsen merged 2 commits into
matplotlib:v1.4.xfrom
tacaswell:fix_legend.framalpha_default
Dec 30, 2014
Merged

jenshnielsen merged 2 commits into
matplotlib:v1.4.xfrom
tacaswell:fix_legend.framalpha_default

Conversation

@tacaswell

Copy link
Copy Markdown
Member

Fixes #3766

Adding legend.framealpha in #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

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
@tacaswell tacaswell added this to the v1.4.3 milestone Nov 9, 2014
@tacaswell tacaswell added API: changes Changes to the public API, typically requiring deprecation. status: needs review topic: rcparams labels Nov 9, 2014
@tacaswell

Copy link
Copy Markdown
Member Author

Can I review my own PR if I don't immediately remember writing it?

jenshnielsen added a commit that referenced this pull request Dec 30, 2014
BUG : correct default value alpha on legend patch
@jenshnielsen
jenshnielsen merged commit 11c0bcc into matplotlib:v1.4.x Dec 30, 2014
@jenshnielsen

Copy link
Copy Markdown
Member

Looks good to me

@tacaswell
tacaswell deleted the fix_legend.framalpha_default branch December 31, 2014 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API: changes Changes to the public API, typically requiring deprecation. topic: rcparams

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants