|
8 | 8 |
|
9 | 9 | `SubPanel`
|
10 | 10 | A logical figure inside a figure, usually added to a figure or parent
|
11 |
| - `SubPanel` with `.add_subpanel` or `.subpanels` methods. |
| 11 | + `SubPanel` with `.add_subpanel` or `.subpanels` methods (provisional |
| 12 | + API v3.4). |
12 | 13 |
|
13 | 14 | `SubplotParams`
|
14 | 15 | Control the default spacing between subplots.
|
@@ -1417,6 +1418,35 @@ def subpanels(self, nrows=1, ncols=1, squeeze=True,
|
1417 | 1418 | wspace=None, hspace=None,
|
1418 | 1419 | width_ratios=None, height_ratios=None,
|
1419 | 1420 | **kwargs):
|
| 1421 | + """ |
| 1422 | + Add a subpanel to this figure or subpanel. A subpanel has the same |
| 1423 | + artist methods as a figure, and is logically the same as a figure. |
| 1424 | + Parameters |
| 1425 | + ---------- |
| 1426 | + nrows, ncols : int, default: 1 |
| 1427 | + Number of rows/columns of the subpanel grid. |
| 1428 | +
|
| 1429 | + squeeze : boolean, default: True |
| 1430 | + If True, extra dimensions are squeezed out from the returned |
| 1431 | + array of subpanels. |
| 1432 | +
|
| 1433 | + wspace, hspace : float, default: None |
| 1434 | + The amount of width/height reserved for space between subpanels, |
| 1435 | + expressed as a fraction of the average subpanel width. |
| 1436 | + If not given, the values will be inferred from a figure or |
| 1437 | + rcParams when necessary. See also `GridSpec.get_subplot_params`. |
| 1438 | +
|
| 1439 | + width_ratios : array-like of length *ncols*, optional |
| 1440 | + Defines the relative widths of the columns. Each column gets a |
| 1441 | + relative width of ``width_ratios[i] / sum(width_ratios)``. |
| 1442 | + If not given, all columns will have the same width. |
| 1443 | +
|
| 1444 | + height_ratios : array-like of length *nrows*, optional |
| 1445 | + Defines the relative heights of the rows. Each column gets a |
| 1446 | + relative height of ``height_ratios[i] / sum(height_ratios)``. |
| 1447 | + If not given, all rows will have the same height. |
| 1448 | +
|
| 1449 | + """ |
1420 | 1450 | gs = GridSpec(nrows=nrows, ncols=ncols, figure=self,
|
1421 | 1451 | wspace=wspace, hspace=hspace,
|
1422 | 1452 | width_ratios=width_ratios,
|
|
0 commit comments