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

Skip to content

Commit 9857e7c

Browse files
authored
Merge pull request #11942 from timhoffm/deprecate-aname
Deprecate Artist.aname and Axes.aname
2 parents 38561b9 + 864fb33 commit 9857e7c

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

doc/api/next_api_changes/2018-07-22-AL-deprecations.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ Support for custom backends that do not provide a ``set_hatch_color`` method is
55
deprecated. We suggest that custom backends let their ``GraphicsContext``
66
class inherit from `GraphicsContextBase`, to at least provide stubs for all
77
required methods.
8+
9+
The fields ``Artist.aname`` and ``Axes.aname`` are deprecated. Please use
10+
``isinstance()`` or ``__class__.__name__`` checks instead.

lib/matplotlib/artist.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,11 @@ class Artist(object):
7171
Abstract base class for someone who renders into a
7272
:class:`FigureCanvas`.
7373
"""
74+
@property
75+
@cbook.deprecated("3.1")
76+
def aname(self):
77+
return 'Artist'
7478

75-
aname = 'Artist'
7679
zorder = 0
7780
# order of precedence when bulk setting/updating properties
7881
# via update. The keys should be property names and the values

lib/matplotlib/axes/_axes.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ class Axes(_AxesBase):
131131
"""
132132
### Labelling, legend and texts
133133

134-
aname = 'Axes'
134+
@property
135+
@cbook.deprecated("3.1")
136+
def aname(self):
137+
return 'Axes'
135138

136139
def get_title(self, loc="center"):
137140
"""

0 commit comments

Comments
 (0)