Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions lib/matplotlib/colorbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,17 @@
Parameters
----------
mappable
The `~matplotlib.cm.ScalarMappable` (i.e., `~matplotlib.image.Image`,
`~matplotlib.contour.ContourSet`, etc.) to which the colorbar applies.
The `matplotlib.cm.ScalarMappable` (i.e., `~matplotlib.image.Image`,
`~matplotlib.contour.ContourSet`, etc.) described by this colorbar.
This argument is mandatory for the `.Figure.colorbar` method but optional
for the `.pyplot.colorbar` function, which sets the default to the current
image.

Note that one can create a `ScalarMappable` "on-the-fly" to generate
colorbars not attached to a previously drawn artist, e.g. ::

fig.colorbar(cm.ScalarMappable(norm=norm, cmap=cmap, ax=ax))

cax : :class:`~matplotlib.axes.Axes` object, optional
Axes into which the colorbar will be drawn.

Expand Down