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

Skip to content

Commit 3560e84

Browse files
authored
Merge pull request #18576 from tacaswell/doc_color_map
DOC: prefer colormap over color map
2 parents 073805f + bdb82e4 commit 3560e84

File tree

25 files changed

+63
-63
lines changed

25 files changed

+63
-63
lines changed

doc/api/prev_api_changes/api_changes_2.0.1.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ line width the final patterns would not change.
5555
There is no way to restore the old behavior.
5656

5757

58-
Deprecate 'Vega' color maps
59-
---------------------------
58+
Deprecate 'Vega' colormaps
59+
--------------------------
6060

6161
The "Vega" colormaps are deprecated in Matplotlib 2.0.1 and will be
6262
removed in Matplotlib 2.2. Use the "tab" colormaps instead: "tab10",

doc/api/prev_api_changes/api_changes_2.2.0.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ The ``Axes.get_axis_bgcolor``, ``Axes.set_axis_bgcolor``,
110110
The unused ``FONT_SCALE`` and ``fontd`` attributes of the `.RendererSVG`
111111
class have been removed.
112112

113-
color maps
114-
~~~~~~~~~~
113+
colormaps
114+
~~~~~~~~~
115115

116116
The ``spectral`` colormap has been removed. The ``Vega*`` colormaps, which
117117
were aliases for the ``tab*`` colormaps, have been removed.

doc/devel/color_changes.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ Default Color changes
55
*********************
66

77
As discussed at length elsewhere [insert links], ``jet`` is an
8-
empirically bad color map and should not be the default color map.
8+
empirically bad colormap and should not be the default colormap.
99
Due to the position that changing the appearance of the plot breaks
1010
backward compatibility, this change has been put off for far longer
1111
than it should have been. In addition to changing the default color
1212
map we plan to take the chance to change the default color-cycle on
13-
plots and to adopt a different color map for filled plots (``imshow``,
13+
plots and to adopt a different colormap for filled plots (``imshow``,
1414
``pcolor``, ``contourf``, etc) and for scatter like plots.
1515

1616

1717
Default Heat Map Colormap
1818
-------------------------
1919

20-
The choice of a new color map is fertile ground to bike-shedding ("No,
20+
The choice of a new colormap is fertile ground to bike-shedding ("No,
2121
it should be _this_ color") so we have a proposed set criteria (via
22-
Nathaniel Smith) to evaluate proposed color maps.
22+
Nathaniel Smith) to evaluate proposed colormaps.
2323

2424
- it should be a sequential colormap, because diverging colormaps are
2525
really misleading unless you know where the "center" of the data is,
@@ -64,9 +64,9 @@ Default Scatter Colormap
6464
------------------------
6565

6666
For heat-map like applications it can be desirable to cover as much of
67-
the luminance scale as possible, however when color mapping markers,
67+
the luminance scale as possible, however when colormapping markers,
6868
having markers too close to white can be a problem. For that reason
69-
we propose using a different (but maybe related) color map to the
69+
we propose using a different (but maybe related) colormap to the
7070
heat map for marker-based. The design parameters are the same as
7171
above, only with a more limited luminance variation.
7272

@@ -102,7 +102,7 @@ Example script
102102
Proposed Colormaps
103103
++++++++++++++++++
104104

105-
Color Cycle / Qualitative color map
105+
Color Cycle / Qualitative colormap
106106
-----------------------------------
107107

108108
When plotting lines it is frequently desirable to plot multiple lines

doc/thirdpartypackages/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ visualisation of data from csv files or `pandas.DataFrame`\s. Main features:
331331

332332
- Scatter, line, density, histogram, and box plot types
333333
- Settings for the marker size, line width, number of bins of histogram,
334-
color map (from cmocean)
334+
colormap (from cmocean)
335335
- Save figure as editable PDF
336336
- Code of the plotted graph is available so that it can be reused and modified
337337
outside of sviewgui

doc/users/dflt_style_changes.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ persistently and selectively revert many of these changes.
2828

2929

3030

31-
Colors, color cycles, and color maps
32-
====================================
31+
Colors, color cycles, and colormaps
32+
===================================
3333

3434
Colors in default property cycle
3535
--------------------------------
@@ -117,7 +117,7 @@ in your :file:`matplotlibrc` file.
117117
Colormap
118118
--------
119119

120-
The new default color map used by `matplotlib.cm.ScalarMappable` instances is
120+
The new default colormap used by `matplotlib.cm.ScalarMappable` instances is
121121
'viridis' (aka `option D <https://bids.github.io/colormap/>`__).
122122

123123
.. plot::
@@ -144,7 +144,7 @@ For an introduction to color theory and how 'viridis' was generated
144144
watch Nathaniel Smith and Stéfan van der Walt's talk from SciPy2015.
145145
See `here for many more details <https://bids.github.io/colormap/>`__
146146
about the other alternatives and the tools used to create the color
147-
map. For details on all of the color maps available in matplotlib see
147+
map. For details on all of the colormaps available in matplotlib see
148148
:doc:`/tutorials/colors/colormaps`.
149149

150150
.. raw:: html
@@ -846,7 +846,7 @@ Interpolation
846846

847847
The default interpolation method for `~matplotlib.axes.Axes.imshow` is
848848
now ``'nearest'`` and by default it resamples the data (both up and down
849-
sampling) before color mapping.
849+
sampling) before colormapping.
850850

851851

852852
.. plot::
@@ -888,16 +888,16 @@ in your :file:`matplotlibrc` file.
888888
Colormapping pipeline
889889
---------------------
890890

891-
Previously, the input data was normalized, then color mapped, and then
891+
Previously, the input data was normalized, then colormapped, and then
892892
resampled to the resolution required for the screen. This meant that
893893
the final resampling was being done in color space. Because the color
894-
maps are not generally linear in RGB space, colors not in the color map
894+
maps are not generally linear in RGB space, colors not in the colormap
895895
may appear in the final image. This bug was addressed by an almost
896896
complete overhaul of the image handling code.
897897

898898
The input data is now normalized, then resampled to the correct
899-
resolution (in normalized dataspace), and then color mapped to
900-
RGB space. This ensures that only colors from the color map appear
899+
resolution (in normalized dataspace), and then colormapped to
900+
RGB space. This ensures that only colors from the colormap appear
901901
in the final image. (If your viewer subsequently resamples the image,
902902
the artifact may reappear.)
903903

doc/users/next_whats_new/colormap_repr.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ IPython representations for Colormap objects
22
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33

44
The `matplotlib.colors.Colormap` object now has image representations for
5-
IPython / Jupyter backends. Cells returning a color map on the last line will
6-
display an image of the color map.
5+
IPython / Jupyter backends. Cells returning a colormap on the last line will
6+
display an image of the colormap.

doc/users/prev_whats_new/changelog.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1980,7 +1980,7 @@ the `API changes <../../api/api_changes.html>`_.
19801980

19811981
2008-04-20 Fix double-zoom bug. - MM
19821982

1983-
2008-04-15 Speed up color mapping. - EF
1983+
2008-04-15 Speed up colormapping. - EF
19841984

19851985
2008-04-12 Speed up zooming and panning of dense images. - EF
19861986

@@ -3197,7 +3197,7 @@ the `API changes <../../api/api_changes.html>`_.
31973197
a sequence of (x,y) tuples for specifying paths in
31983198
collections, quiver, contour, pcolor, transforms.
31993199
Fixed contour bug involving setting limits for
3200-
color mapping. Added numpy-style all() to numerix. - EF
3200+
colormapping. Added numpy-style all() to numerix. - EF
32013201

32023202
2006-06-20 Added custom FigureClass hook to pylab interface - see
32033203
examples/custom_figure_class.py

doc/users/prev_whats_new/whats_new_2.0.0.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,11 @@ Improved image support
187187
----------------------
188188

189189
Prior to version 2.0, matplotlib resampled images by first applying
190-
the color map and then resizing the result. Since the resampling was
190+
the colormap and then resizing the result. Since the resampling was
191191
performed on the colored image, this introduced colors in the output
192-
image that didn't actually exist in the color map. Now, images are
192+
image that didn't actually exist in the colormap. Now, images are
193193
resampled first (and entirely in floating-point, if the input image is
194-
floating-point), and then the color map is applied.
194+
floating-point), and then the colormap is applied.
195195

196196
In order to make this important change, the image handling code was
197197
almost entirely rewritten. As a side effect, image resampling uses

examples/images_contours_and_fields/image_masked.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
# set up the Axes objects
4646
fig, (ax1, ax2) = plt.subplots(nrows=2, figsize=(6, 5.4))
4747

48-
# plot using 'continuous' color map
48+
# plot using 'continuous' colormap
4949
im = ax1.imshow(Zm, interpolation='bilinear',
5050
cmap=palette,
5151
norm=colors.Normalize(vmin=-1.0, vmax=1.0),

examples/mplot3d/surface3d.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
"""
2-
======================
3-
3D surface (color map)
4-
======================
2+
=====================
3+
3D surface (colormap)
4+
=====================
55
6-
Demonstrates plotting a 3D surface colored with the coolwarm color map.
6+
Demonstrates plotting a 3D surface colored with the coolwarm colormap.
77
The surface is made opaque by using antialiased=False.
88
99
Also demonstrates using the LinearLocator and custom formatting for the

examples/mplot3d/surface3d_radial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
=================================
55
66
Demonstrates plotting a surface defined in polar coordinates.
7-
Uses the reversed version of the YlGnBu color map.
7+
Uses the reversed version of the YlGnBu colormap.
88
Also demonstrates writing axis labels with latex math mode.
99
1010
Example contributed by Armin Moser.

lib/matplotlib/_cm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def _prism_blue(x): return -1.1 * np.sin((x * 20.9) * np.pi)
5454
_prism_data = {'red': _prism_red, 'green': _prism_green, 'blue': _prism_blue}
5555

5656
def _ch_helper(gamma, s, r, h, p0, p1, x):
57-
"""Helper function for generating picklable cubehelix color maps."""
57+
"""Helper function for generating picklable cubehelix colormaps."""
5858
# Apply gamma factor to emphasise low or high intensity values
5959
xg = x ** gamma
6060
# Calculate amplitude and angle of deviation from the black to white
@@ -1096,7 +1096,7 @@ def _gist_heat_blue(x): return 4 * x - 3
10961096
def _gist_yarg(x): return 1 - x
10971097
_gist_yarg_data = {'red': _gist_yarg, 'green': _gist_yarg, 'blue': _gist_yarg}
10981098

1099-
# This bipolar color map was generated from CoolWarmFloat33.csv of
1099+
# This bipolar colormap was generated from CoolWarmFloat33.csv of
11001100
# "Diverging Color Maps for Scientific Visualization" by Kenneth Moreland.
11011101
# <http://www.kennethmoreland.com/color-maps/>
11021102
_coolwarm_data = {

lib/matplotlib/axes/_axes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4472,7 +4472,7 @@ def hexbin(self, x, y, C=None, gridsize=100, bins=None,
44724472
44734473
- If *None*, no binning is applied; the color of each hexagon
44744474
directly corresponds to its count value.
4475-
- If 'log', use a logarithmic scale for the color map.
4475+
- If 'log', use a logarithmic scale for the colormap.
44764476
Internally, :math:`log_{10}(i+1)` is used to determine the
44774477
hexagon color. This is equivalent to ``norm=LogNorm()``.
44784478
- If an integer, divide the counts in the specified number
@@ -5239,7 +5239,7 @@ def imshow(self, X, cmap=None, norm=None, aspect=None,
52395239
52405240
The input may either be actual RGB(A) data, or 2D scalar data, which
52415241
will be rendered as a pseudocolor image. For displaying a grayscale
5242-
image set up the color mapping using the parameters
5242+
image set up the colormapping using the parameters
52435243
``cmap='gray', vmin=0, vmax=255``.
52445244
52455245
The number of pixels used to render an image is set by the axes size

lib/matplotlib/collections.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1795,7 +1795,7 @@ class PatchCollection(Collection):
17951795
"""
17961796
A generic collection of patches.
17971797
1798-
This makes it easier to assign a color map to a heterogeneous
1798+
This makes it easier to assign a colormap to a heterogeneous
17991799
collection of patches.
18001800
18011801
This also may improve plotting speed, since PatchCollection will

lib/matplotlib/colorbar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
*values* None or a sequence which must be of length 1 less
137137
than the sequence of *boundaries*. For each region
138138
delimited by adjacent entries in *boundaries*, the
139-
color mapped to the corresponding value in values
139+
colormapped to the corresponding value in values
140140
will be used.
141141
============ ===================================================
142142

lib/matplotlib/colors.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -703,14 +703,14 @@ def _init(self):
703703
raise NotImplementedError("Abstract class only")
704704

705705
def is_gray(self):
706-
"""Return whether the color map is grayscale."""
706+
"""Return whether the colormap is grayscale."""
707707
if not self._isinit:
708708
self._init()
709709
return (np.all(self._lut[:, 0] == self._lut[:, 1]) and
710710
np.all(self._lut[:, 0] == self._lut[:, 2]))
711711

712712
def _resample(self, lutsize):
713-
"""Return a new color map with *lutsize* entries."""
713+
"""Return a new colormap with *lutsize* entries."""
714714
raise NotImplementedError()
715715

716716
def reversed(self, name=None):
@@ -738,7 +738,7 @@ def _repr_png_(self):
738738
(_REPR_PNG_SIZE[1], 1))
739739
pixels = self(X, bytes=True)
740740
png_bytes = io.BytesIO()
741-
title = self.name + ' color map'
741+
title = self.name + ' colormap'
742742
author = f'Matplotlib v{mpl.__version__}, https://matplotlib.org'
743743
pnginfo = PngInfo()
744744
pnginfo.add_text('Title', title)
@@ -766,7 +766,7 @@ def color_block(color):
766766
f'<strong>{self.name}</strong> '
767767
'</div>'
768768
'<div class="cmap"><img '
769-
f'alt="{self.name} color map" '
769+
f'alt="{self.name} colormap" '
770770
f'title="{self.name}" '
771771
'style="border: 1px solid #555;" '
772772
f'src="data:image/png;base64,{png_base64}"></div>'
@@ -795,7 +795,7 @@ class LinearSegmentedColormap(Colormap):
795795

796796
def __init__(self, name, segmentdata, N=256, gamma=1.0):
797797
"""
798-
Create color map from linear mapping segments
798+
Create colormap from linear mapping segments
799799
800800
segmentdata argument is a dictionary with a red, green and blue
801801
entries. Each entry should be a list of *x*, *y0*, *y1* tuples,
@@ -858,7 +858,7 @@ def _init(self):
858858
self._set_extremes()
859859

860860
def set_gamma(self, gamma):
861-
"""Set a new gamma value and regenerate color map."""
861+
"""Set a new gamma value and regenerate colormap."""
862862
self._gamma = gamma
863863
self._init()
864864

@@ -902,7 +902,7 @@ def from_list(name, colors, N=256, gamma=1.0):
902902
return LinearSegmentedColormap(name, cdict, N, gamma)
903903

904904
def _resample(self, lutsize):
905-
"""Return a new color map with *lutsize* entries."""
905+
"""Return a new colormap with *lutsize* entries."""
906906
new_cmap = LinearSegmentedColormap(self.name, self._segmentdata,
907907
lutsize)
908908
new_cmap._rgba_over = self._rgba_over
@@ -1006,7 +1006,7 @@ def _init(self):
10061006
self._set_extremes()
10071007

10081008
def _resample(self, lutsize):
1009-
"""Return a new color map with *lutsize* entries."""
1009+
"""Return a new colormap with *lutsize* entries."""
10101010
colors = self(np.linspace(0, 1, lutsize))
10111011
new_cmap = ListedColormap(colors, name=self.name)
10121012
# Keep the over/under values too

lib/matplotlib/contour.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1191,7 +1191,7 @@ def _process_colors(self):
11911191
"""
11921192
Color argument processing for contouring.
11931193
1194-
Note that we base the color mapping on the contour levels
1194+
Note that we base the colormapping on the contour levels
11951195
and layers, not on the actual range of the Z values. This
11961196
means we don't have to worry about bad values in Z, and we
11971197
always have the full dynamic range available for the selected

lib/matplotlib/image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ def _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification=1.0,
462462
# would not full eliminate it and breaks a number of
463463
# tests (due to the slightly different error bouncing
464464
# some pixels across a boundary in the (very
465-
# quantized) color mapping step).
465+
# quantized) colormapping step).
466466
offset = .1
467467
frac = .8
468468
# we need to run the vmin/vmax through the same rescaling

lib/matplotlib/pyplot.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2007,8 +2007,8 @@ def colormaps():
20072007
for nominal data that has no inherent ordering, where color is used
20082008
only to distinguish categories
20092009
2010-
Matplotlib ships with 4 perceptually uniform color maps which are
2011-
the recommended color maps for sequential data:
2010+
Matplotlib ships with 4 perceptually uniform colormaps which are
2011+
the recommended colormaps for sequential data:
20122012
20132013
========= ===================================================
20142014
Colormap Description
@@ -2087,7 +2087,7 @@ def colormaps():
20872087
Colormap Description
20882088
========= =======================================================
20892089
autumn sequential linearly-increasing shades of red-orange-yellow
2090-
bone sequential increasing black-white color map with
2090+
bone sequential increasing black-white colormap with
20912091
a tinge of blue, to emulate X-ray film
20922092
cool linearly-decreasing shades of cyan-magenta
20932093
copper sequential increasing shades of black-copper
@@ -2128,7 +2128,7 @@ def colormaps():
21282128
Language software
21292129
============ =======================================================
21302130
2131-
A set of cyclic color maps:
2131+
A set of cyclic colormaps:
21322132
21332133
================ =================================================
21342134
Colormap Description

0 commit comments

Comments
 (0)