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

Skip to content

Commit 6a35abf

Browse files
authored
Merge pull request #19621 from anntzer/getaxes
Dedupe docstrings of Figure.{get_axes,axes}.
2 parents bac91f5 + 1e1c9fc commit 6a35abf

File tree

1 file changed

+14
-23
lines changed

1 file changed

+14
-23
lines changed

lib/matplotlib/figure.py

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1976,27 +1976,22 @@ def init_layoutgrid(self):
19761976
parent_pos=(self._subplotspec.rowspan,
19771977
self._subplotspec.colspan))
19781978

1979-
def get_axes(self):
1979+
@property
1980+
def axes(self):
19801981
"""
1981-
Return a list of Axes in the SubFigure. You can access and modify the
1982-
Axes in the Figure through this list.
1982+
List of Axes in the SubFigure. You can access and modify the Axes
1983+
in the SubFigure through this list.
19831984
19841985
Do not modify the list itself. Instead, use `~.SubFigure.add_axes`,
19851986
`~.SubFigure.add_subplot` or `~.SubFigure.delaxes` to add or remove an
19861987
Axes.
19871988
1988-
Note: This is equivalent to the property `~.SubFigure.axes`.
1989+
Note: The `.SubFigure.axes` property and `~.SubFigure.get_axes` method
1990+
are equivalent.
19891991
"""
19901992
return self._localaxes.as_list()
19911993

1992-
axes = property(get_axes, doc="""
1993-
List of Axes in the SubFigure. You can access and modify the Axes
1994-
in the SubFigure through this list.
1995-
1996-
Do not modify the list itself. Instead, use `~.SubFigure.add_axes`,
1997-
`~.SubFigure.add_subplot` or `~.SubFigure.delaxes` to add or remove an
1998-
Axes.
1999-
""")
1994+
get_axes = axes.fget
20001995

20011996
def draw(self, renderer):
20021997
# docstring inherited
@@ -2211,25 +2206,21 @@ def show(self, warn=True):
22112206
except NonGuiException as exc:
22122207
_api.warn_external(str(exc))
22132208

2214-
def get_axes(self):
2209+
@property
2210+
def axes(self):
22152211
"""
2216-
Return a list of Axes in the Figure. You can access and modify the
2217-
Axes in the Figure through this list.
2212+
List of Axes in the Figure. You can access and modify the Axes in the
2213+
Figure through this list.
22182214
22192215
Do not modify the list itself. Instead, use `~Figure.add_axes`,
22202216
`~.Figure.add_subplot` or `~.Figure.delaxes` to add or remove an Axes.
22212217
2222-
Note: This is equivalent to the property `~.Figure.axes`.
2218+
Note: The `.Figure.axes` property and `~.Figure.get_axes` method are
2219+
equivalent.
22232220
"""
22242221
return self._axstack.as_list()
22252222

2226-
axes = property(get_axes, doc="""
2227-
List of Axes in the Figure. You can access and modify the Axes in the
2228-
Figure through this list.
2229-
2230-
Do not modify the list itself. Instead, use "`~Figure.add_axes`,
2231-
`~.Figure.add_subplot` or `~.Figure.delaxes` to add or remove an Axes.
2232-
""")
2223+
get_axes = axes.fget
22332224

22342225
def _get_dpi(self):
22352226
return self._dpi

0 commit comments

Comments
 (0)