Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit dbe7c2d

Browse filesBrowse files
authored
Merge pull request #25873 from tacaswell/doc/colorbar_spacestealing
DOC: clarify how colorbar steals space
2 parents 9e1359d + 3eb3c87 commit dbe7c2d
Copy full SHA for dbe7c2d

File tree

Expand file treeCollapse file tree

1 file changed

+9
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-4
lines changed

‎lib/matplotlib/figure.py

Copy file name to clipboardExpand all lines: lib/matplotlib/figure.py
+9-4Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,12 +1223,16 @@ def colorbar(
12231223
fig.colorbar(cm.ScalarMappable(norm=norm, cmap=cmap), ax=ax)
12241224
12251225
cax : `~matplotlib.axes.Axes`, optional
1226-
Axes into which the colorbar will be drawn.
1226+
Axes into which the colorbar will be drawn. If `None`, then a new
1227+
Axes is created and the space for it will be stolen from the Axes(s)
1228+
specified in *ax*.
12271229
12281230
ax : `~.axes.Axes` or iterable or `numpy.ndarray` of Axes, optional
1229-
One or more parent axes from which space for a new colorbar axes
1230-
will be stolen, if *cax* is None. This has no effect if *cax* is
1231-
set.
1231+
The one or more parent Axes from which space for a new colorbar Axes
1232+
will be stolen. This parameter is only used if *cax* is not set.
1233+
1234+
Defaults to the Axes that contains the mappable used to create the
1235+
colorbar.
12321236
12331237
use_gridspec : bool, optional
12341238
If *cax* is ``None``, a new *cax* is created as an instance of
@@ -1269,6 +1273,7 @@ def colorbar(
12691273
However, this has negative consequences in other circumstances, e.g.
12701274
with semi-transparent images (alpha < 1) and colorbar extensions;
12711275
therefore, this workaround is not used by default (see issue #1188).
1276+
12721277
"""
12731278

12741279
if ax is None:

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.