54
54
55
55
_log = logging .getLogger (__name__ )
56
56
57
- make_axes_kw_doc = """
58
-
59
- ============= ====================================================
60
- Property Description
61
- ============= ====================================================
62
- *orientation* vertical or horizontal
63
- *fraction* 0.15; fraction of original axes to use for colorbar
64
- *pad* 0.05 if vertical, 0.15 if horizontal; fraction
65
- of original axes between colorbar and new image axes
66
- *shrink* 1.0; fraction by which to multiply the size of the colorbar
67
- *aspect* 20; ratio of long to short dimensions
68
- * anchor* (0.0, 0.5) if vertical; (0.5, 1.0) if horizontal;
69
- the anchor point of the colorbar axes
70
- *panchor* (1 .0, 0.5) if vertical; (0.5, 0 .0) if horizontal;
71
- the anchor point of the colorbar parent axes. If
72
- False, the parent axes' anchor will be unchanged
73
- ============= ====================================================
74
-
57
+ _make_axes_param_doc = """
58
+ fraction : float, default: 0.15
59
+ Fraction of original axes to use for colorbar.
60
+ shrink : float, default: 1.0
61
+ Fraction by which to multiply the size of the colorbar.
62
+ aspect : float, default: 20
63
+ Ratio of long to short dimensions.
64
+ """
65
+ _make_axes_other_param_doc = """
66
+ pad : float, default: 0.05 if vertical, 0.15 if horizontal
67
+ Fraction of original axes between colorbar and new image axes.
68
+ anchor : (float, float), optional
69
+ The anchor point of the colorbar axes.
70
+ Defaults to (0 .0, 0.5) if vertical; (0.5, 1 .0) if horizontal.
71
+ panchor : (float, float), or *False*, optional
72
+ The anchor point of the colorbar parent axes. If * False* , the parent
73
+ axes' anchor will be unchanged.
74
+ Defaults to (1.0, 0.5) if vertical; (0.5, 0.0) if horizontal.
75
75
"""
76
+ make_axes_kw_doc = _make_axes_param_doc + _make_axes_other_param_doc
76
77
77
78
colormap_kw_doc = """
78
79
@@ -1362,7 +1363,7 @@ def remove(self):
1362
1363
ax .set_subplotspec (subplotspec )
1363
1364
1364
1365
1365
- @docstring .Substitution (make_axes_kw_doc )
1366
+ @docstring .Substitution (_make_axes_param_doc , _make_axes_other_param_doc )
1366
1367
def make_axes (parents , location = None , orientation = None , fraction = 0.15 ,
1367
1368
shrink = 1.0 , aspect = 20 , ** kw ):
1368
1369
"""
@@ -1371,21 +1372,33 @@ def make_axes(parents, location=None, orientation=None, fraction=0.15,
1371
1372
The axes is placed in the figure of the *parents* axes, by resizing and
1372
1373
repositioning *parents*.
1373
1374
1374
- Keyword arguments may include the following (with defaults):
1375
+ Parameters
1376
+ ----------
1377
+ parents : `~.axes.Axes` or list of `~.axes.Axes`
1378
+ The Axes to use as parents for placing the colorbar.
1375
1379
1376
- location : None or {'left', 'right', 'top', 'bottom'}
1377
- The position, relative to *parents*, where the colorbar axes
1378
- should be created. If None, the value will either come from the
1379
- given ``orientation``, else it will default to 'right'.
1380
+ location : None or {'left', 'right', 'top', 'bottom'}
1381
+ The position, relative to *parents*, where the colorbar axes
1382
+ should be created. If None, the value will either come from the
1383
+ given ``orientation``, else it will default to 'right'.
1380
1384
1381
- orientation : None or {'vertical', 'horizontal'}
1382
- The orientation of the colorbar. Typically, this keyword shouldn't
1383
- be used, as it can be derived from the ``location`` keyword.
1385
+ orientation : None or {'vertical', 'horizontal'}
1386
+ The orientation of the colorbar. Typically, this keyword shouldn't
1387
+ be used, as it can be derived from the ``location`` keyword.
1384
1388
1385
1389
%s
1386
1390
1387
- Returns (cax, kw), the child axes and the reduced kw dictionary to be
1388
- passed when creating the colorbar instance.
1391
+ Returns
1392
+ -------
1393
+ cax : `~.axes.Axes`
1394
+ The child axes.
1395
+ kw : dict
1396
+ The reduced keyword dictionary to be passed when creating the colorbar
1397
+ instance.
1398
+
1399
+ Other Parameters
1400
+ ----------------
1401
+ %s
1389
1402
"""
1390
1403
locations = ["left" , "right" , "top" , "bottom" ]
1391
1404
if orientation is not None and location is not None :
@@ -1519,7 +1532,7 @@ def make_axes(parents, location=None, orientation=None, fraction=0.15,
1519
1532
return cax , kw
1520
1533
1521
1534
1522
- @docstring .Substitution (make_axes_kw_doc )
1535
+ @docstring .Substitution (_make_axes_param_doc , _make_axes_other_param_doc )
1523
1536
def make_axes_gridspec (parent , * , fraction = 0.15 , shrink = 1.0 , aspect = 20 , ** kw ):
1524
1537
"""
1525
1538
Create a `~.SubplotBase` suitable for a colorbar.
@@ -1530,30 +1543,40 @@ def make_axes_gridspec(parent, *, fraction=0.15, shrink=1.0, aspect=20, **kw):
1530
1543
This function is similar to `.make_axes`. Primary differences are
1531
1544
1532
1545
- `.make_axes_gridspec` only handles the *orientation* keyword
1533
- and cannot handle the " location" keyword.
1546
+ and cannot handle the * location* keyword.
1534
1547
1535
1548
- `.make_axes_gridspec` should only be used with a `.SubplotBase` parent.
1536
1549
1537
1550
- `.make_axes` creates an `~.axes.Axes`; `.make_axes_gridspec` creates a
1538
1551
`.SubplotBase`.
1539
1552
1540
1553
- `.make_axes` updates the position of the parent. `.make_axes_gridspec`
1541
- replaces the ``grid_spec`` attribute of the parent with a new one.
1554
+ replaces the ``grid_spec`` attribute of the parent with a new one.
1542
1555
1543
1556
While this function is meant to be compatible with `.make_axes`,
1544
1557
there could be some minor differences.
1545
1558
1546
- Keyword arguments may include the following (with defaults):
1547
-
1548
- *orientation*
1549
- 'vertical' or 'horizontal'
1559
+ Parameters
1560
+ ----------
1561
+ parent : `~.axes.Axes`
1562
+ The Axes to use as parent for placing the colorbar.
1550
1563
1551
1564
%s
1552
1565
1553
- All but the first of these are stripped from the input kw set.
1566
+ Returns
1567
+ -------
1568
+ cax : `~.axes.SubplotBase`
1569
+ The child axes.
1570
+ kw : dict
1571
+ The reduced keyword dictionary to be passed when creating the colorbar
1572
+ instance.
1554
1573
1555
- Returns (cax, kw), the child axes and the reduced kw dictionary to be
1556
- passed when creating the colorbar instance.
1574
+ Other Parameters
1575
+ ----------------
1576
+ orientation : {'vertical', 'horizontal'}, default: 'vertical'
1577
+ The orientation of the colorbar.
1578
+
1579
+ %s
1557
1580
"""
1558
1581
1559
1582
orientation = kw .setdefault ('orientation' , 'vertical' )
0 commit comments