Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Make colorbar docstring numpydoc #9516

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 22, 2017
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
49 changes: 26 additions & 23 deletions lib/matplotlib/colorbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,31 +140,40 @@
colorbar(mappable, cax=cax, **kwargs)
colorbar(mappable, ax=ax, **kwargs)

arguments:

*mappable*
the :class:`~matplotlib.image.Image`,
Parameters
----------
mappable :
The :class:`~matplotlib.image.Image`,
:class:`~matplotlib.contour.ContourSet`, etc. to
which the colorbar applies; this argument is mandatory for the
which the colorbar applies; this argument is mandatory for the Figure
:meth:`~matplotlib.figure.Figure.colorbar` method but optional for the
:func:`~matplotlib.pyplot.colorbar` function, which sets the
pyplot :func:`~matplotlib.pyplot.colorbar` function, which sets the
default to the current image.

keyword arguments:

*cax*
None | axes object into which the colorbar will be drawn
*ax*
None | parent axes object(s) 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*
False | 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 : :class:`~matplotlib.axes.Axes` object, optional
Axis 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
-------
:class:`~matplotlib.colorbar.Colorbar` instance
See also its base class, :class:`~matplotlib.colorbar.ColorbarBase`.
Call the :meth:`~matplotlib.colorbar.ColorbarBase.set_label` method
to label the colorbar.

Notes
-----
Additional keyword arguments are of two kinds:

axes properties:
Expand Down Expand Up @@ -198,12 +207,6 @@
with semi transparent images (alpha < 1) and colorbar extensions and is not
enabled by default see (issue #1188).

returns:
:class:`~matplotlib.colorbar.Colorbar` instance; see also its base class,
:class:`~matplotlib.colorbar.ColorbarBase`. Call the
:meth:`~matplotlib.colorbar.ColorbarBase.set_label` method
to label the colorbar.

''' % (make_axes_kw_doc, colormap_kw_doc)

docstring.interpd.update(colorbar_doc=colorbar_doc)
Expand Down