8000 Reword some colorbar docs. (#12799) · matplotlib/matplotlib@56243e9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 56243e9

Browse files
anntzerImportanceOfBeingErnest
authored andcommitted
Reword some colorbar docs. (#12799)
1 parent 44c0ef5 commit 56243e9

File tree

1 file changed

+17
-21
lines changed

1 file changed

+17
-21
lines changed

lib/matplotlib/colorbar.py

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,11 @@
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 applies.
146+
This argument is mandatory for the `.Figure.colorbar` method but optional
147+
for the `.pyplot.colorbar` function, which sets the default to the current
148+
image.
150149
151150
cax : :class:`~matplotlib.axes.Axes` object, optional
152151
Axes into which the colorbar will be drawn.
@@ -157,18 +156,15 @@
157156
colorbar axes.
158157
159158
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-
159+
If *cax* is ``None``, a new *cax* is created as an instance of Axes. If
160+
*ax* is an instance of Subplot and *use_gridspec* is ``True``, *cax* is
161+
created as an instance of Subplot using the :mod:`~.gridspec` module.
165162
166163
Returns
167164
-------
168165
: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.
166+
See also its base class, `~matplotlib.colorbar.ColorbarBase`. Call the
167+
`~.ColorbarBase.set_label` method to label the colorbar.
172168
173169
Notes
174170
-----
@@ -183,25 +179,25 @@
183179
kwarg is included automatically.
184180
185181
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
182+
to the axes. Note that if *cax* is specified, it determines the size of the
187183
colorbar and *shrink* and *aspect* kwargs are ignored.
188184
189185
For more precise control, you can manually specify the positions of
190186
the axes objects in which the mappable and the colorbar are drawn. In
191187
this case, do not use any of the axes properties kwargs.
192188
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
189+
It is known that some vector graphics viewers (svg and pdf) renders white gaps
190+
between segments of the colorbar. This is due to bugs in the viewers, not
191+
Matplotlib. As a workaround, the colorbar can be rendered with overlapping
196192
segments::
197193
198194
cbar = colorbar()
199195
cbar.solids.set_edgecolor("face")
200196
draw()
201197
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).
198+
However this has negative consequences in other circumstances, e.g. with
199+
semi-transparent images (alpha < 1) and colorbar extensions; therefore, this
200+
workaround is not used by default (see issue #1188).
205201
206202
''' % (make_axes_kw_doc, colormap_kw_doc)
207203

0 commit comments

Comments
 (0)
0