8000 Update docs on subplot2grid · matplotlib/matplotlib@4a99187 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4a99187

Browse files
committed
Update docs on subplot2grid
1 parent 898bd5f commit 4a99187

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

lib/matplotlib/pyplot.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ def axes(arg=None, **kwargs):
872872
The exact behavior of this function depends on the type:
873873
874874
- *None*: A new full window axes is added using
875-
``subplot(111, **kwargs)``
875+
``subplot(111, **kwargs)``.
876876
- 4-tuple of floats *rect* = ``[left, bottom, width, height]``.
877877
A new axes is added with dimensions *rect* in normalized
878878
(0, 1) units using `~.Figure.add_axes` on the current figure.
@@ -1278,22 +1278,32 @@ def subplots(nrows=1, ncols=1, sharex=False, sharey=False, squeeze=True,
12781278

12791279
def subplot2grid(shape, loc, rowspan=1, colspan=1, fig=None, **kwargs):
12801280
"""
1281-
Create an axis at specific location inside a regular grid.
1281+
Create a subplot at a specific location inside a regular grid.
12821282
12831283
Parameters
12841284
----------
12851285
shape : (int, int)
12861286
Number of rows and of columns of the grid in which to place axis.
12871287
loc : (int, int)
12881288
Row number and column number of the axis location within the grid.
1289-
rowspan : int
1289+
rowspan : int, default: 1
12901290
Number of rows for the axis to span to the right.
1291-
colspan : int
1291+
colspan : int. default: 1
12921292
Number of columns for the axis to span downwards.
12931293
fig : `.Figure`, optional
1294-
Figure to place axis in. Defaults to current figure.
1294+
Figure to place the subplot in. Defaults to the current figure.
12951295
**kwargs
1296-
Additional keyword arguments are handed to `add_subplot`.
1296+
Additional keyword arguments are handed to `~.Figure.add_subplot`.
1297+
1298+
Returns
1299+
-------
1300+
`.axes.SubplotBase`, or another subclass of `~.axes.Axes`
1301+
1302+
The axes of the subplot. The returned axes base class depends on
1303+
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
1306+
base class.
12971307
12981308
Notes
12991309
-----

0 commit comments

Comments
 (0)
0