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

Skip to content

Commit 1ef7c13

Browse files
authored
Merge pull request #9231 from tacaswell/fix_deprecation_properties
FIX: add missing property decorators
2 parents c3d57bc + 940962a commit 1ef7c13

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,6 +1096,7 @@ def cla(self):
10961096

10971097
self.stale = True
10981098

1099+
@property
10991100
@cbook.deprecated("2.1", alternative="Axes.patch")
11001101
def axesPatch(self):
11011102
return self.patch

lib/matplotlib/figure.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ def __init__(self,
369369
self.clf()
370370
self._cachedRenderer = None
371371

372+
@property
372373
@cbook.deprecated("2.1", alternative="Figure.patch")
373374
def figurePatch(self):
374375
return self.patch

lib/matplotlib/tests/test_axes.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5319,3 +5319,12 @@ def test_barh_signature(args, kwargs, warning_count):
53195319
def test_zero_linewidth():
53205320
# Check that setting a zero linewidth doesn't error
53215321
plt.plot([0, 1], [0, 1], ls='--', lw=0)
5322+
5323+
5324+
def test_patch_deprecations():
5325+
fig, ax = plt.subplots()
5326+
with warnings.catch_warnings(record=True) as w:
5327+
assert ax.patch == ax.axesPatch
5328+
assert fig.patch == fig.figurePatch
5329+
5330+
assert len(w) == 2

0 commit comments

Comments
 (0)