Skip to content

Commit 9cfe4e9

Browse files
committed
DOC: clarify how colorbar steals space
1 parent 5a89bdb commit 9cfe4e9

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

lib/matplotlib/figure.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,12 +1220,16 @@ def colorbar(
12201220
fig.colorbar(cm.ScalarMappable(norm=norm, cmap=cmap), ax=ax)
12211221
12221222
cax : `~matplotlib.axes.Axes`, optional
1223-
Axes into which the colorbar will be drawn.
1223+
Axes into which the colorbar will be drawn. If `None`, then space
1224+
will be stolen from the Axes(s) specified in *ax*
12241225
12251226
ax : `~.axes.Axes` or iterable or `numpy.ndarray` of Axes, optional
1226-
One or more parent axes from which space for a new colorbar axes
1227-
will be stolen, if *cax* is None. This has no effect if *cax* is
1228-
set.
1227+
If `None`, defaults to ``mappable.axes``.
1228+
1229+
If *cax* is None, specifies the one or more parent axes from which
1230+
space for a new colorbar axes will be stolen.
1231+
1232+
This has no effect if *cax* is set.
12291233
12301234
use_gridspec : bool, optional
12311235
If *cax* is ``None``, a new *cax* is created as an instance of

0 commit comments

Comments
 (0)