|
33 | 33 |
|
34 | 34 | import copy
|
35 | 35 | import logging
|
| 36 | +import textwrap |
36 | 37 |
|
37 | 38 | import numpy as np
|
38 | 39 |
|
|
53 | 54 | _log = logging.getLogger(__name__)
|
54 | 55 |
|
55 | 56 | _make_axes_param_doc = """
|
56 |
| - location : None or {'left', 'right', 'top', 'bottom'} |
57 |
| - The location, relative to the parent axes, where the colorbar axes |
58 |
| - is created. It also determines the *orientation* of the colorbar |
59 |
| - (colorbars on the left and right are vertical, colorbars at the top |
60 |
| - and bottom are horizontal). If None, the location will come from the |
61 |
| - *orientation* if it is set (vertical colorbars on the right, horizontal |
62 |
| - ones at the bottom), or default to 'right' if *orientation* is unset. |
63 |
| - orientation : None or {'vertical', 'horizontal'} |
64 |
| - The orientation of the colorbar. It is preferrable to set the |
65 |
| - *location* of the colorbar, as that also determines the *orientation*; |
66 |
| - passing incompatible values for *location* and *orientation* raises an |
67 |
| - exception. |
68 |
| - fraction : float, default: 0.15 |
69 |
| - Fraction of original axes to use for colorbar. |
70 |
| - shrink : float, default: 1.0 |
71 |
| - Fraction by which to multiply the size of the colorbar. |
72 |
| - aspect : float, default: 20 |
73 |
| - Ratio of long to short dimensions. |
| 57 | +location : None or {'left', 'right', 'top', 'bottom'} |
| 58 | + The location, relative to the parent axes, where the colorbar axes |
| 59 | + is created. It also determines the *orientation* of the colorbar |
| 60 | + (colorbars on the left and right are vertical, colorbars at the top |
| 61 | + and bottom are horizontal). If None, the location will come from the |
| 62 | + *orientation* if it is set (vertical colorbars on the right, horizontal |
| 63 | + ones at the bottom), or default to 'right' if *orientation* is unset. |
| 64 | +orientation : None or {'vertical', 'horizontal'} |
| 65 | + The orientation of the colorbar. It is preferrable to set the *location* |
| 66 | + of the colorbar, as that also determines the *orientation*; passing |
| 67 | + incompatible values for *location* and *orientation* raises an exception. |
| 68 | +fraction : float, default: 0.15 |
| 69 | + Fraction of original axes to use for colorbar. |
| 70 | +shrink : float, default: 1.0 |
| 71 | + Fraction by which to multiply the size of the colorbar. |
| 72 | +aspect : float, default: 20 |
| 73 | + Ratio of long to short dimensions. |
74 | 74 | """
|
75 | 75 | _make_axes_other_param_doc = """
|
76 |
| - pad : float, default: 0.05 if vertical, 0.15 if horizontal |
77 |
| - Fraction of original axes between colorbar and new image axes. |
78 |
| - anchor : (float, float), optional |
79 |
| - The anchor point of the colorbar axes. |
80 |
| - Defaults to (0.0, 0.5) if vertical; (0.5, 1.0) if horizontal. |
81 |
| - panchor : (float, float), or *False*, optional |
82 |
| - The anchor point of the colorbar parent axes. If *False*, the parent |
83 |
| - axes' anchor will be unchanged. |
84 |
| - Defaults to (1.0, 0.5) if vertical; (0.5, 0.0) if horizontal. |
| 76 | +pad : float, default: 0.05 if vertical, 0.15 if horizontal |
| 77 | + Fraction of original axes between colorbar and new image axes. |
| 78 | +anchor : (float, float), optional |
| 79 | + The anchor point of the colorbar axes. |
| 80 | + Defaults to (0.0, 0.5) if vertical; (0.5, 1.0) if horizontal. |
| 81 | +panchor : (float, float), or *False*, optional |
| 82 | + The anchor point of the colorbar parent axes. If *False*, the parent |
| 83 | + axes' anchor will be unchanged. |
| 84 | + Defaults to (1.0, 0.5) if vertical; (0.5, 0.0) if horizontal. |
85 | 85 | """
|
86 | 86 |
|
87 | 87 | _colormap_kw_doc = """
|
|
214 | 214 | However this has negative consequences in other circumstances, e.g. with
|
215 | 215 | semi-transparent images (alpha < 1) and colorbar extensions; therefore, this
|
216 | 216 | workaround is not used by default (see issue #1188).
|
217 |
| -""" % (_make_axes_param_doc, _make_axes_other_param_doc, _colormap_kw_doc)) |
| 217 | +""" % (textwrap.indent(_make_axes_param_doc, " "), |
| 218 | + textwrap.indent(_make_axes_other_param_doc, " "), |
| 219 | + _colormap_kw_doc)) |
218 | 220 |
|
219 | 221 | # Deprecated since 3.4.
|
220 | 222 | colorbar_doc = docstring.interpd.params["colorbar_doc"]
|
|