Thanks to visit codestin.com
Credit goes to github.com

Skip to content

FIX: add missing property decorators #9231

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

Merged
merged 1 commit into from
Sep 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/matplotlib/axes/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,7 @@ def cla(self):

self.stale = True

@property
@cbook.deprecated("2.1", alternative="Axes.patch")
def axesPatch(self):
return self.patch
Expand Down
1 change: 1 addition & 0 deletions lib/matplotlib/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ def __init__(self,
self.clf()
self._cachedRenderer = None

@property
@cbook.deprecated("2.1", alternative="Figure.patch")
def figurePatch(self):
return self.patch
Expand Down
9 changes: 9 additions & 0 deletions lib/matplotlib/tests/test_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5319,3 +5319,12 @@ def test_barh_signature(args, kwargs, warning_count):
def test_zero_linewidth():
# Check that setting a zero linewidth doesn't error
plt.plot([0, 1], [0, 1], ls='--', lw=0)


def test_patch_deprecations():
fig, ax = plt.subplots()
with warnings.catch_warnings(record=True) as w:
assert ax.patch == ax.axesPatch
assert fig.patch == fig.figurePatch

assert len(w) == 2