Skip to content

Commit c3b0b86

Browse files
committed
Update subplot2grid doc to use Figure.add_gridspec, not GridSpec.
1 parent 5445d77 commit c3b0b86

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/matplotlib/pyplot.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,13 +1299,13 @@ def subplot2grid(shape, loc, rowspan=1, colspan=1, fig=None, **kwargs):
12991299
-----
13001300
The following call ::
13011301
1302-
subplot2grid(shape, loc, rowspan=1, colspan=1)
1302+
subplot2grid((nrows, ncols), (row, col), rowspan, colspan)
13031303
13041304
is identical to ::
13051305
1306-
gridspec = GridSpec(shape[0], shape[1])
1307-
subplotspec = gridspec.new_subplotspec(loc, rowspan, colspan)
1308-
subplot(subplotspec)
1306+
fig = gcf()
1307+
fig.add_subplot(
1308+
fig.add_gridspec(nrows, ncols)[row:row+rowspan, col:col+colspan])
13091309
"""
13101310

13111311
if fig is None:

0 commit comments

Comments
 (0)