8000 Merge pull request #25873 from tacaswell/doc/colorbar_spacestealing · matplotlib/matplotlib@41a16d4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 41a16d4

Browse files
timhoffmtacaswell
authored andcommitted
Merge pull request #25873 from tacaswell/doc/colorbar_spacestealing
DOC: clarify how colorbar steals space (cherry picked from commit dbe7c2d)
1 parent 59e32b1 commit 41a16d4

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

lib/matplotlib/figure.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,12 +1221,16 @@ def colorbar(
12211221
fig.colorbar(cm.ScalarMappable(norm=norm, cmap=cmap), ax=ax)
12221222
12231223
cax : `~matplotlib.axes.Axes`, optional
1224-
Axes into which the colorbar will be drawn.
1224+
Axes into which the colorbar will be drawn. If `None`, then a new
1225+
Axes is created and the space for it will be stolen from the Axes(s)
1226+
specified in *ax*.
12251227
12261228
ax : `~.axes.Axes` or iterable or `numpy.ndarray` of Axes, optional
1227-
One or more parent axes from which space for a new colorbar axes
1228-
will be stolen, if *cax* is None. This has no effect if *cax* is
1229-
set.
1229+
The one or more parent Axes from which space for a new colorbar Axes
1230+
will be stolen. This parameter is only used if *cax* is not set.
1231+
1232+
Defaults to the Axes that contains the mappable used to create the
1233+
colorbar.
12301234
12311235
use_gridspec : bool, optional
12321236
If *cax* is ``None``, a new *cax* is created as an instance of
@@ -1267,6 +1271,7 @@ def colorbar(
12671271
However, this has negative 56FA consequences in other circumstances, e.g.
12681272
with semi-transparent images (alpha < 1) and colorbar extensions;
12691273
therefore, this workaround is not used by default (see issue #1188).
1274+
12701275
"""
12711276

12721277
if ax is None:

0 commit comments

Comments
 (0)
0