FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix polar facecolor by tacaswell · Pull Request #6001 · matplotlib/matplotlib · GitHub

Repository navigation

Fix polar facecolor - #6001

Merged
mdboom merged 6 commits into
matplotlib:v2.xfrom
tacaswell:fix_polar_facecolor
Feb 15, 2016
Merged

mdboom merged 6 commits into
matplotlib:v2.xfrom
tacaswell:fix_polar_facecolor

Conversation

Copy link
Copy Markdown
Member

Closes #5996

 - change name of first kwarg (third arg) of `_AxesBase.__init__`
   from 'axisbg' -> 'facecolor'.
 - added 'axisbg' back at the end of the listed kwargs
 - add handling from axisbg / facecolor conflicts

This adds a minor, but nasty, API wart in that there are now two
positional arguements to set the background color of the axes and API
wise we are locked into one positional arg.  However, if any non-None
value is passed for `axisbg` a warning will be raised and this is the
`__init__` on a private base class so should have reatively little
user exposure.
_axisbg -> _facecolor

Finishing the change from axisbg -> facecolor
tacaswell added this to the 2.0 (style change major release) milestone Feb 14, 2016
Comment thread lib/matplotlib/axes/_base.py Outdated
else:
if axisbg is not None and facecolor is not None:
raise TypeError('Both axisbg and facecolor are not None. '
'These keywords are aliases, only one maybe '

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

maybe -> may be

Comment thread lib/matplotlib/axes/_base.py Outdated
@@ -2722,7 +2727,7 @@ def set_axis_bgcolor(self, color):
warnings.warn(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Is this warning still needed, given the decorator?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think you are correct.

Copy link
Copy Markdown
Member Author

Also noticed that we do not even really need that private variable, so fully removed it.

mdboom commented Feb 15, 2016

Copy link
Copy Markdown
Member

👍 I think this may already be on master, though: 5f1127c

Copy link
Copy Markdown
Member Author

well, drat.

Copy link
Copy Markdown
Member Author

This PR looks like it touches a bit more than #5501 does. This adds face_color as an explicit kwarg that the _BaseAxes.__init__ pulls off rather than letting it fall all the way through to the update method.

I need to rip out half of the last commit.

 - the decorator takes care of the warning
 - fall back got get/set_facecolor instead of private internal state

Copy link
Copy Markdown
Member Author

There is a sutble API difference between set_axis_bgcolor and set_facecolor, the later (used to) set the internal self._facecolor (self._axisbg) attribute which is what cla() uses to restore the color.

When setting the facecolor stash the value so that future calls to `cla`
will restore the facecolor to this value.
mdboom added a commit that referenced this pull request Feb 15, 2016
mdboom merged commit 47b70ea into matplotlib:v2.x Feb 15, 2016
tacaswell deleted the fix_polar_facecolor branch May 12, 2016 21:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

3 participants


Back | FazBrowse Home | New Git URL