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

Skip to content

Commit 797d7eb

Browse files
committed
Convert subplot2grid doscring to numpydoc
1 parent c216019 commit 797d7eb

File tree

1 file changed

+32
-8
lines changed

1 file changed

+32
-8
lines changed

lib/matplotlib/pyplot.py

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,18 +1186,42 @@ def subplots(nrows=1, ncols=1, sharex=False, sharey=False, squeeze=True,
11861186

11871187
def subplot2grid(shape, loc, rowspan=1, colspan=1, fig=None, **kwargs):
11881188
"""
1189-
Create a subplot in a grid. The grid is specified by *shape*, at
1190-
location of *loc*, spanning *rowspan*, *colspan* cells in each
1191-
direction. The index for loc is 0-based. The current figure will
1192-
be used unless *fig* is specified. ::
1189+
Create an axis at specific location inside a regular grid.
11931190
1194-
subplot2grid(shape, loc, rowspan=1, colspan=1)
1191+
Parameters
1192+
----------
1193+
shape : sequence of 2 ints
1194+
Shape of grid in which to place axis.
1195+
First entry is number of rows, second entry is number of columns.
1196+
1197+
loc : sequence of 2 ints
1198+
Location to place axis within grid.
1199+
First entry is row number, second entry is column number.
1200+
1201+
rowspan : int
1202+
Number of rows for the axis to span to the right.
1203+
1204+
colspan : int
1205+
Number of columns for the axis to span downwards.
1206+
1207+
fig : `Figure`, optional
1208+
Figure to place axis in. Defaults to current figure.
1209+
1210+
**kwargs
1211+
Additional keyword arguments are handed to `add_subplot`.
1212+
1213+
1214+
Notes
1215+
-----
1216+
The following call ::
1217+
1218+
subplot2grid(shape, loc, rowspan=1, colspan=1)
11951219
11961220
is identical to ::
11971221
1198-
gridspec=GridSpec(shape[0], shape[1])
1199-
subplotspec=gridspec.new_subplotspec(loc, rowspan, colspan)
1200-
subplot(subplotspec)
1222+
gridspec=GridSpec(shape[0], shape[1])
1223+
subplotspec=gridspec.new_subplotspec(loc, rowspan, colspan)
1224+
subplot(subplotspec)
12011225
"""
12021226

12031227
if fig is None:

0 commit comments

Comments
 (0)