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

Skip to content

Commit bb82a50

Browse files
authored
Merge pull request #9516 from dstansby/colorbar-docstring
Make colorbar docstring numpydoc
2 parents 00ca196 + 6ab5d4a commit bb82a50

File tree

1 file changed

+26
-23
lines changed

1 file changed

+26
-23
lines changed

lib/matplotlib/colorbar.py

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -140,31 +140,40 @@
140140
colorbar(mappable, cax=cax, **kwargs)
141141
colorbar(mappable, ax=ax, **kwargs)
142142
143-
arguments:
144-
145-
*mappable*
146-
the :class:`~matplotlib.image.Image`,
143+
Parameters
144+
----------
145+
mappable :
146+
The :class:`~matplotlib.image.Image`,
147147
:class:`~matplotlib.contour.ContourSet`, etc. to
148-
which the colorbar applies; this argument is mandatory for the
148+
which the colorbar applies; this argument is mandatory for the Figure
149149
:meth:`~matplotlib.figure.Figure.colorbar` method but optional for the
150-
:func:`~matplotlib.pyplot.colorbar` function, which sets the
150+
pyplot :func:`~matplotlib.pyplot.colorbar` function, which sets the
151151
default to the current image.
152152
153-
keyword arguments:
154-
155-
*cax*
156-
None | axes object into which the colorbar will be drawn
157-
*ax*
158-
None | parent axes object(s) from which space for a new
159-
colorbar axes will be stolen. If a list of axes is given
160-
they will all be resized to make room for the colorbar axes.
161-
*use_gridspec*
162-
False | If *cax* is None, a new *cax* is created as an instance of
163-
Axes. If *ax* is an instance of Subplot and *use_gridspec* is True,
153+
cax : :class:`~matplotlib.axes.Axes` object, optional
154+
Axis into which the colorbar will be drawn
155+
156+
ax : :class:`~matplotlib.axes.Axes`, list of Axes, optional
157+
Parent axes from which space for a new colorbar axes will be stolen.
158+
If a list of axes is given they will all be resized to make room for the
159+
colorbar axes.
160+
161+
use_gridspec : bool, optional
162+
If *cax* is ``None``, a new *cax* is created as an instance of
163+
Axes. If *ax* is an instance of Subplot and *use_gridspec* is ``True``,
164164
*cax* is created as an instance of Subplot using the
165165
grid_spec module.
166166
167167
168+
Returns
169+
-------
170+
:class:`~matplotlib.colorbar.Colorbar` instance
171+
See also its base class, :class:`~matplotlib.colorbar.ColorbarBase`.
172+
Call the :meth:`~matplotlib.colorbar.ColorbarBase.set_label` method
173+
to label the colorbar.
174+
175+
Notes
176+
-----
168177
Additional keyword arguments are of two kinds:
169178
170179
axes properties:
@@ -196,12 +205,6 @@
196205
with semi transparent images (alpha < 1) and colorbar extensions and is not
197206
enabled by default see (issue #1188).
198207
199-
returns:
200-
:class:`~matplotlib.colorbar.Colorbar` instance; see also its base class,
201-
:class:`~matplotlib.colorbar.ColorbarBase`. Call the
202-
:meth:`~matplotlib.colorbar.ColorbarBase.set_label` method
203-
to label the colorbar.
204-
205208
''' % (make_axes_kw_doc, colormap_kw_doc)
206209

207210
docstring.interpd.update(colorbar_doc=colorbar_doc)

0 commit comments

Comments
 (0)