colorbar(mappable, cax=None, ax=None, use_gridspec=True, **kw) method of matplotlib.figure.Figure instance
Create a colorbar for a ScalarMappable instance, *mappable*.
Documentation for the pyplot thin wrapper:
Add a colorbar to a plot.
Function signatures for the :mod:`~matplotlib.pyplot` interface; all
but the first are also method signatures for the
:meth:`~matplotlib.figure.Figure.colorbar` method::
colorbar(**kwargs)
colorbar(mappable, **kwargs)
colorbar(mappable, cax=cax, **kwargs)
colorbar(mappable, ax=ax, **kwargs)
Parameters
----------
mappable :
The :class:`~matplotlib.image.Image`,
:class:`~matplotlib.contour.ContourSet`, etc. to
which the colorbar applies; this argument is mandatory for the Figure
:meth:`~matplotlib.figure.Figure.colorbar` method but optional for the
pyplot :func:`~matplotlib.pyplot.colorbar` function, which sets the
default to the current image.
cax : :class:`~matplotlib.axes.Axes` object, optional
Axes into which the colorbar will be drawn.
ax : :class:`~matplotlib.axes.Axes`, list of Axes, optional
Parent axes from which space for a new colorbar axes will be stolen.
If a list of axes is given they will all be resized to make room for the
colorbar axes.
use_gridspec : bool, optional
If *cax* is ``None``, a new *cax* is created as an instance of
Axes. If *ax* is an instance of Subplot and *use_gridspec* is ``True``,
*cax* is created as an instance of Subplot using the
grid_spec module.
Returns
-------
colorbar : `~matplotlib.c
python colorbar
最新推荐文章于 2024-05-15 15:02:05 发布