8000 Deprecate Artist.aname and Axes.aname · matplotlib/matplotlib@06be041 · GitHub
[go: up one dir, main page]

Skip to content

Commit 06be041

Browse files
committed
Deprecate Artist.aname and Axes.aname
1 parent 76fe3ab commit 06be041

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-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: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,10 @@ class Artist(object):
7171
Abstract base class for someone who renders into a
7272
:class:`FigureCanvas`.
7373
"""
74+
@cbook.deprecated("3.1")
75+
def aname(self):
76+
return 'Artist'
7477

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

lib/matplotlib/axes/_axes.py

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

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

136138
def get_title(self, loc="center"):
137139
"""

0 commit comments

Comments
 (0)
0