8000 Reword some colorbar docs. · matplotlib/matplotlib@4fb7d2f · GitHub
[go: up one dir, main page]

Skip to content

Commit 4fb7d2f

Browse files
committed
Reword some colorbar docs.
1 parent 3e90025 commit 4fb7d2f

File tree

1 file changed

+18
-21
lines changed

1 file changed

+18
-21
lines changed

lib/matplotlib/colorbar.py

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,12 @@
141141
Parameters
142142
----------
143143
mappable
144-
The :class:`~matplotlib.image.Image`,
145-
:class:`~matplotlib.contour.ContourSet`, etc. to
146-
which the colorbar applies; this argument is mandatory for the Figure
147-
:meth:`~matplotlib.figure.Figure.colorbar` method but optional for the
148-
pyplot :func:`~matplotlib.pyplot.colorbar` function, which sets the
149-
default to the current image.
144+
The `~matplotlib.cm.ScalarMappable` (i.e., `~matplotlib.image.Image`,
145+
`~matplotlib.contour.ContourSet`, etc.) to which the colorbar
146+
applies. This argument is mandatory for the Figure method
147+
`~matplotlib.figure.Figure.colorbar` but optional for the pyplot function
148+
`~matplotlib.pyplot.colorbar` function, which sets the default to the
149+
current image.
150150
151151
cax : :class:`~matplotlib.axes.Axes` object, optional
152152
Axes into which the colorbar will be drawn.
@@ -157,18 +157,15 @@
157157
colorbar axes.
158158
159159
use_gridspec : bool, optional
160-
If *cax* is ``None``, a new *cax* is created as an instance of
161-
Axes. If *ax* is an instance of Subplot and *use_gridspec* is ``True``,
162-
*cax* is created as an instance of Subplot using the
163-
grid_spec module.
164-
160+
If *cax* is ``None``, a new *cax* is created as an instance of Axes. If
161+
*ax* is an instance of Subplot and *use_gridspec* is ``True``, *cax* is
162+
created as an instance of Subplot using the :mod:`~.gridspec` module.
165163
166164
Returns
167165
-------
168166
:class:`~matplotlib.colorbar.Colorbar` instance
169-
See also its base class, :class:`~matplotlib.colorbar.ColorbarBase`.
170-
Call the :meth:`~matplotlib.colorbar.ColorbarBase.set_label` method
171-
to label the colorbar.
167+
See also its base class, `~matplotlib.colorbar.ColorbarBase`. Call the
168+
`~.set_label` method to label the colorbar.
172169
173170
Notes
174171
-----
@@ -183,25 +180,25 @@
183180
kwarg is included automatically.
184181
185182
The *shrink* kwarg provides a simple way to scale the colorbar with respect
186-
to the axes. Note that if *cax* is specified it determines the size of the
183+
to the axes. Note that if *cax* is specified, it determines the size of the
187184
colorbar and *shrink* and *aspect* kwargs are ignored.
188185
189186
For more precise control, you can manually specify the positions of
190187
the axes objects in which the mappable and the colorbar are drawn. In
191188
this case, do not use any of the axes properties kwargs.
192189
193-
It is known that some vector graphics viewer (svg and pdf) renders white gaps
194-
between segments of the colorbar. This is due to bugs in the viewers not
195-
matplotlib. As a workaround the colorbar can be rendered with overlapping
190+
It is known that some vector graphics viewers (svg and pdf) renders white gaps
191+
between segments of the colorbar. This is due to bugs in the viewers, not
192+
Matplotlib. As a workaround, the colorbar can be rendered with overlapping
196193
segments::
197194
198195
cbar = colorbar()
199196
cbar.solids.set_edgecolor("face")
200197
draw()
201198
202-
However this has negative consequences in other circumstances. Particularly
203-
with semi transparent images (alpha < 1) and colorbar extensions and is not
204-
enabled by default see (issue #1188).
199+
However this has negative consequences in other circumstances, e.g. with
200+
semi-transparent images (alpha < 1) and colorbar extensions; therefore, this
201+
workaround is not used by default (see issue #1188).
205202
206203
''' % (make_axes_kw_doc, colormap_kw_doc)
207204

0 commit comments

Comments
 (0)
0