File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 141141Parameters
142142----------
143143mappable
144- The `~ matplotlib.cm.ScalarMappable` (i.e., `~matplotlib.image.Image`,
145- `~matplotlib.contour.ContourSet`, etc.) to which the colorbar applies .
144+ The `matplotlib.cm.ScalarMappable` (i.e., `~matplotlib.image.Image`,
145+ `~matplotlib.contour.ContourSet`, etc.) described by this colorbar.
146146 This argument is mandatory for the `.Figure.colorbar` method but optional
147147 for the `.pyplot.colorbar` function, which sets the default to the current
148148 image.
149149
150+ Note that one can create a `ScalarMappable` "on-the-fly" to generate
151+ colorbars not attached to a previously drawn artist, e.g. ::
152+
153+ fig.colorbar(cm.ScalarMappable(norm=norm, cmap=cmap, ax=ax))
154+
150155cax : :class:`~matplotlib.axes.Axes` object, optional
151156 Axes into which the colorbar will be drawn.
152157
You can’t perform that action at this time.
0 commit comments