Skip to content

Commit d8d755e

Browse files
committed
Update docs on SubplotBase
1 parent 4a99187 commit d8d755e

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

lib/matplotlib/axes/_subplots.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ def __init__(self, fig, *args, **kwargs):
3030
If *nrows*, *ncols*, and *index* are all single digit numbers, then
3131
*args* can be passed as a single 3-digit number (e.g. 234 for
3232
(2, 3, 4)).
33+
34+
**kwargs
35+
Keyword arguments are passed to the Axes (sub)class constructor.
3336
"""
3437

3538
self.figure = fig
@@ -78,15 +81,15 @@ def change_geometry(self, numrows, numcols, num):
7881
self.set_position(self.figbox)
7982

8083
def get_subplotspec(self):
81-
"""Return the SubplotSpec instance associated with the subplot."""
84+
"""Return the `.SubplotSpec` instance associated with the subplot."""
8285
return self._subplotspec
8386

8487
def set_subplotspec(self, subplotspec):
85-
"""Set the SubplotSpec instance associated with the subplot."""
88+
"""Set the `.SubplotSpec`. instance associated with the subplot."""
8689
self._subplotspec = subplotspec
8790

8891
def get_gridspec(self):
89-
"""Return the GridSpec instance associated with the subplot."""
92+
"""Return the `.GridSpec` instance associated with the subplot."""
9093
return self._subplotspec.get_gridspec()
9194

9295
def update_params(self):

lib/matplotlib/figure.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -1149,11 +1149,10 @@ def add_axes(self, *args, **kwargs):
11491149
11501150
Returns
11511151
-------
1152-
`~.axes.Axes` (or a subclass of `~.axes.Axes`)
1152+
`~.axes.Axes`, or a subclass of `~.axes.Axes`
11531153
The returned axes class depends on the projection used. It is
1154-
`~.axes.Axes` if rectilinear projection are used and
1155-
`.projections.polar.PolarAxes` if polar projection
1156-
are used.
1154+
`~.axes.Axes` if rectilinear projection is used and
1155+
`.projections.polar.PolarAxes` if polar projection is used.
11571156
11581157
Other Parameters
11591158
----------------
@@ -1309,8 +1308,8 @@ def add_subplot(self, *args, **kwargs):
13091308
13101309
The axes of the subplot. The returned axes base class depends on
13111310
the projection used. It is `~.axes.Axes` if rectilinear projection
1312-
are used and `.projections.polar.PolarAxes` if polar projection
1313-
are used. The returned axes is then a subplot subclass of the
1311+
is used and `.projections.polar.PolarAxes` if polar projection
1312+
is used. The returned axes is then a subplot subclass of the
13141313
base class.
13151314
13161315
Other Parameters

lib/matplotlib/pyplot.py

+9-11
Original file line numberDiff line numberDiff line change
@@ -896,11 +896,10 @@ def axes(arg=None, **kwargs):
896896
897897
Returns
898898
-------
899-
`~.axes.Axes` (or a subclass of `~.axes.Axes`)
899+
`~.axes.Axes`, or a subclass of `~.axes.Axes`
900900
The returned axes class depends on the projection used. It is
901-
`~.axes.Axes` if rectilinear projection are used and
902-
`.projections.polar.PolarAxes` if polar projection
903-
are used.
901+
`~.axes.Axes` if rectilinear projection is used and
902+
`.projections.polar.PolarAxes` if polar projection is used.
904903
905904
Other Parameters
906905
----------------
@@ -1023,13 +1022,12 @@ def subplot(*args, **kwargs):
10231022
10241023
Returns
10251024
-------
1026-
an `.axes.SubplotBase` subclass of `~.axes.Axes` (or a subclass of \
1027-
`~.axes.Axes`)
1025+
`.axes.SubplotBase`, or another subclass of `~.axes.Axes`
10281026
10291027
The axes of the subplot. The returned axes base class depends on
10301028
the projection used. It is `~.axes.Axes` if rectilinear projection
1031-
are used and `.projections.polar.PolarAxes` if polar projection
1032-
are used. The returned axes is then a subplot subclass of the
1029+
is used and `.projections.polar.PolarAxes` if polar projection
1030+
is used. The returned axes is then a subplot subclass of the
10331031
base class.
10341032
10351033
Other Parameters
@@ -1288,7 +1286,7 @@ def subplot2grid(shape, loc, rowspan=1, colspan=1, fig=None, **kwargs):
12881286
Row number and column number of the axis location within the grid.
12891287
rowspan : int, default: 1
12901288
Number of rows for the axis to span to the right.
1291-
colspan : int. default: 1
1289+
colspan : int, default: 1
12921290
Number of columns for the axis to span downwards.
12931291
fig : `.Figure`, optional
12941292
Figure to place the subplot in. Defaults to the current figure.
@@ -1301,8 +1299,8 @@ def subplot2grid(shape, loc, rowspan=1, colspan=1, fig=None, **kwargs):
13011299
13021300
The axes of the subplot. The returned axes base class depends on
13031301
the projection used. It is `~.axes.Axes` if rectilinear projection
1304-
are used and `.projections.polar.PolarAxes` if polar projection
1305-
are used. The returned axes is then a subplot subclass of the
1302+
is used and `.projections.polar.PolarAxes` if polar projection
1303+
is used. The returned axes is then a subplot subclass of the
13061304
base class.
13071305
13081306
Notes

0 commit comments

Comments
 (0)