Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

DOC: prefer colormap over color map#18576

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
jklymak merged 1 commit intomatplotlib:masterfromtacaswell:doc_color_map
Sep 25, 2020
Merged
Show file tree
Hide file tree
Changes fromall 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
4 changes: 2 additions & 2 deletionsdoc/api/prev_api_changes/api_changes_2.0.1.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -55,8 +55,8 @@ line width the final patterns would not change.
There is no way to restore the old behavior.


Deprecate 'Vega'color maps
---------------------------
Deprecate 'Vega'colormaps
--------------------------

The "Vega" colormaps are deprecated in Matplotlib 2.0.1 and will be
removed in Matplotlib 2.2. Use the "tab" colormaps instead: "tab10",
Expand Down
4 changes: 2 additions & 2 deletionsdoc/api/prev_api_changes/api_changes_2.2.0.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -110,8 +110,8 @@ The ``Axes.get_axis_bgcolor``, ``Axes.set_axis_bgcolor``,
The unused ``FONT_SCALE`` and ``fontd`` attributes of the `.RendererSVG`
class have been removed.

color maps
~~~~~~~~~~
colormaps
~~~~~~~~~

The ``spectral`` colormap has been removed. The ``Vega*`` colormaps, which
were aliases for the ``tab*`` colormaps, have been removed.
Expand Down
14 changes: 7 additions & 7 deletionsdoc/devel/color_changes.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,21 +5,21 @@ Default Color changes
*********************

As discussed at length elsewhere [insert links], ``jet`` is an
empirically badcolor mapand should not be the defaultcolor map.
empirically badcolormapand should not be the defaultcolormap.
Due to the position that changing the appearance of the plot breaks
backward compatibility, this change has been put off for far longer
than it should have been. In addition to changing the default color
map we plan to take the chance to change the default color-cycle on
plots and to adopt a differentcolor map for filled plots (``imshow``,
plots and to adopt a differentcolormap for filled plots (``imshow``,
``pcolor``, ``contourf``, etc) and for scatter like plots.


Default Heat Map Colormap
-------------------------

The choice of a newcolor map is fertile ground to bike-shedding ("No,
The choice of a newcolormap is fertile ground to bike-shedding ("No,
it should be _this_ color") so we have a proposed set criteria (via
Nathaniel Smith) to evaluate proposedcolor maps.
Nathaniel Smith) to evaluate proposedcolormaps.

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

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

Expand DownExpand Up@@ -102,7 +102,7 @@ Example script
Proposed Colormaps
++++++++++++++++++

Color Cycle / Qualitativecolor map
Color Cycle / Qualitativecolormap
-----------------------------------

When plotting lines it is frequently desirable to plot multiple lines
Expand Down
2 changes: 1 addition & 1 deletiondoc/thirdpartypackages/index.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -331,7 +331,7 @@ visualisation of data from csv files or `pandas.DataFrame`\s. Main features:

- Scatter, line, density, histogram, and box plot types
- Settings for the marker size, line width, number of bins of histogram,
color map (from cmocean)
colormap (from cmocean)
- Save figure as editable PDF
- Code of the plotted graph is available so that it can be reused and modified
outside of sviewgui
Expand Down
18 changes: 9 additions & 9 deletionsdoc/users/dflt_style_changes.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -28,8 +28,8 @@ persistently and selectively revert many of these changes.



Colors, color cycles, andcolor maps
====================================
Colors, color cycles, andcolormaps
===================================

Colors in default property cycle
--------------------------------
Expand DownExpand Up@@ -117,7 +117,7 @@ in your :file:`matplotlibrc` file.
Colormap
--------

The new defaultcolor map used by `matplotlib.cm.ScalarMappable` instances is
The new defaultcolormap used by `matplotlib.cm.ScalarMappable` instances is
'viridis' (aka `option D <https://bids.github.io/colormap/>`__).

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

.. raw:: html
Expand DownExpand Up@@ -846,7 +846,7 @@ Interpolation

The default interpolation method for `~matplotlib.axes.Axes.imshow` is
now ``'nearest'`` and by default it resamples the data (both up and down
sampling) beforecolor mapping.
sampling) beforecolormapping.


.. plot::
Expand DownExpand Up@@ -888,16 +888,16 @@ in your :file:`matplotlibrc` file.
Colormapping pipeline
---------------------

Previously, the input data was normalized, thencolor mapped, and then
Previously, the input data was normalized, thencolormapped, and then
resampled to the resolution required for the screen. This meant that
the final resampling was being done in color space. Because the color
maps are not generally linear in RGB space, colors not in thecolor map
maps are not generally linear in RGB space, colors not in thecolormap
may appear in the final image. This bug was addressed by an almost
complete overhaul of the image handling code.

The input data is now normalized, then resampled to the correct
resolution (in normalized dataspace), and thencolor mapped to
RGB space. This ensures that only colors from thecolor map appear
resolution (in normalized dataspace), and thencolormapped to
RGB space. This ensures that only colors from thecolormap appear
in the final image. (If your viewer subsequently resamples the image,
the artifact may reappear.)

Expand Down
4 changes: 2 additions & 2 deletionsdoc/users/next_whats_new/colormap_repr.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,5 +2,5 @@ IPython representations for Colormap objects
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The `matplotlib.colors.Colormap` object now has image representations for
IPython / Jupyter backends. Cells returning acolor map on the last line will
display an image of thecolor map.
IPython / Jupyter backends. Cells returning acolormap on the last line will
display an image of thecolormap.
4 changes: 2 additions & 2 deletionsdoc/users/prev_whats_new/changelog.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1980,7 +1980,7 @@ the `API changes <../../api/api_changes.html>`_.

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

2008-04-15 Speed upcolor mapping. - EF
2008-04-15 Speed upcolormapping. - EF

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

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

2006-06-20 Added custom FigureClass hook to pylab interface - see
examples/custom_figure_class.py
Expand Down
6 changes: 3 additions & 3 deletionsdoc/users/prev_whats_new/whats_new_2.0.0.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -187,11 +187,11 @@ Improved image support
----------------------

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

In order to make this important change, the image handling code was
almost entirely rewritten. As a side effect, image resampling uses
Expand Down
2 changes: 1 addition & 1 deletionexamples/images_contours_and_fields/image_masked.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -45,7 +45,7 @@
# set up the Axes objects
fig, (ax1, ax2) = plt.subplots(nrows=2, figsize=(6, 5.4))

# plot using 'continuous'color map
# plot using 'continuous'colormap
im = ax1.imshow(Zm, interpolation='bilinear',
cmap=palette,
norm=colors.Normalize(vmin=-1.0, vmax=1.0),
Expand Down
8 changes: 4 additions & 4 deletionsexamples/mplot3d/surface3d.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
"""
======================
3D surface (color map)
======================
=====================
3D surface (colormap)
=====================

Demonstrates plotting a 3D surface colored with the coolwarmcolor map.
Demonstrates plotting a 3D surface colored with the coolwarmcolormap.
The surface is made opaque by using antialiased=False.

Also demonstrates using the LinearLocator and custom formatting for the
Expand Down
2 changes: 1 addition & 1 deletionexamples/mplot3d/surface3d_radial.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,7 +4,7 @@
=================================

Demonstrates plotting a surface defined in polar coordinates.
Uses the reversed version of the YlGnBucolor map.
Uses the reversed version of the YlGnBucolormap.
Also demonstrates writing axis labels with latex math mode.

Example contributed by Armin Moser.
Expand Down
4 changes: 2 additions & 2 deletionslib/matplotlib/_cm.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -54,7 +54,7 @@ def _prism_blue(x): return -1.1 * np.sin((x * 20.9) * np.pi)
_prism_data = {'red': _prism_red, 'green': _prism_green, 'blue': _prism_blue}

def _ch_helper(gamma, s, r, h, p0, p1, x):
"""Helper function for generating picklable cubehelixcolor maps."""
"""Helper function for generating picklable cubehelixcolormaps."""
# Apply gamma factor to emphasise low or high intensity values
xg = x ** gamma
# Calculate amplitude and angle of deviation from the black to white
Expand DownExpand Up@@ -1096,7 +1096,7 @@ def _gist_heat_blue(x): return 4 * x - 3
def _gist_yarg(x): return 1 - x
_gist_yarg_data = {'red': _gist_yarg, 'green': _gist_yarg, 'blue': _gist_yarg}

# This bipolarcolor map was generated from CoolWarmFloat33.csv of
# This bipolarcolormap was generated from CoolWarmFloat33.csv of
# "Diverging Color Maps for Scientific Visualization" by Kenneth Moreland.
# <http://www.kennethmoreland.com/color-maps/>
_coolwarm_data = {
Expand Down
4 changes: 2 additions & 2 deletionslib/matplotlib/axes/_axes.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4472,7 +4472,7 @@ def hexbin(self, x, y, C=None, gridsize=100, bins=None,

- If *None*, no binning is applied; the color of each hexagon
directly corresponds to its count value.
- If 'log', use a logarithmic scale for thecolor map.
- If 'log', use a logarithmic scale for thecolormap.
Internally, :math:`log_{10}(i+1)` is used to determine the
hexagon color. This is equivalent to ``norm=LogNorm()``.
- If an integer, divide the counts in the specified number
Expand DownExpand Up@@ -5239,7 +5239,7 @@ def imshow(self, X, cmap=None, norm=None, aspect=None,

The input may either be actual RGB(A) data, or 2D scalar data, which
will be rendered as a pseudocolor image. For displaying a grayscale
image set up thecolor mapping using the parameters
image set up thecolormapping using the parameters
``cmap='gray', vmin=0, vmax=255``.

The number of pixels used to render an image is set by the axes size
Expand Down
2 changes: 1 addition & 1 deletionlib/matplotlib/collections.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1795,7 +1795,7 @@ class PatchCollection(Collection):
"""
A generic collection of patches.

This makes it easier to assign acolor map to a heterogeneous
This makes it easier to assign acolormap to a heterogeneous
collection of patches.

This also may improve plotting speed, since PatchCollection will
Expand Down
2 changes: 1 addition & 1 deletionlib/matplotlib/colorbar.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -136,7 +136,7 @@
*values* None or a sequence which must be of length 1 less
than the sequence of *boundaries*. For each region
delimited by adjacent entries in *boundaries*, the
color mapped to the corresponding value in values
colormapped to the corresponding value in values
will be used.
============ ===================================================

Expand Down
16 changes: 8 additions & 8 deletionslib/matplotlib/colors.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -703,14 +703,14 @@ def _init(self):
raise NotImplementedError("Abstract class only")

def is_gray(self):
"""Return whether thecolor map is grayscale."""
"""Return whether thecolormap is grayscale."""
if not self._isinit:
self._init()
return (np.all(self._lut[:, 0] == self._lut[:, 1]) and
np.all(self._lut[:, 0] == self._lut[:, 2]))

def _resample(self, lutsize):
"""Return a newcolor map with *lutsize* entries."""
"""Return a newcolormap with *lutsize* entries."""
raise NotImplementedError()

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

def __init__(self, name, segmentdata, N=256, gamma=1.0):
"""
Createcolor map from linear mapping segments
Createcolormap from linear mapping segments

segmentdata argument is a dictionary with a red, green and blue
entries. Each entry should be a list of *x*, *y0*, *y1* tuples,
Expand DownExpand Up@@ -858,7 +858,7 @@ def _init(self):
self._set_extremes()

def set_gamma(self, gamma):
"""Set a new gamma value and regeneratecolor map."""
"""Set a new gamma value and regeneratecolormap."""
self._gamma = gamma
self._init()

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

def _resample(self, lutsize):
"""Return a newcolor map with *lutsize* entries."""
"""Return a newcolormap with *lutsize* entries."""
new_cmap = LinearSegmentedColormap(self.name, self._segmentdata,
lutsize)
new_cmap._rgba_over = self._rgba_over
Expand DownExpand Up@@ -1006,7 +1006,7 @@ def _init(self):
self._set_extremes()

def _resample(self, lutsize):
"""Return a newcolor map with *lutsize* entries."""
"""Return a newcolormap with *lutsize* entries."""
colors = self(np.linspace(0, 1, lutsize))
new_cmap = ListedColormap(colors, name=self.name)
# Keep the over/under values too
Expand Down
2 changes: 1 addition & 1 deletionlib/matplotlib/contour.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1191,7 +1191,7 @@ def _process_colors(self):
"""
Color argument processing for contouring.

Note that we base thecolor mapping on the contour levels
Note that we base thecolormapping on the contour levels
and layers, not on the actual range of the Z values. This
means we don't have to worry about bad values in Z, and we
always have the full dynamic range available for the selected
Expand Down
2 changes: 1 addition & 1 deletionlib/matplotlib/image.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -462,7 +462,7 @@ def _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification=1.0,
# would not full eliminate it and breaks a number of
# tests (due to the slightly different error bouncing
# some pixels across a boundary in the (very
# quantized)color mapping step).
# quantized)colormapping step).
offset = .1
frac = .8
# we need to run the vmin/vmax through the same rescaling
Expand Down
8 changes: 4 additions & 4 deletionslib/matplotlib/pyplot.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2007,8 +2007,8 @@ def colormaps():
for nominal data that has no inherent ordering, where color is used
only to distinguish categories

Matplotlib ships with 4 perceptually uniformcolor maps which are
the recommendedcolor maps for sequential data:
Matplotlib ships with 4 perceptually uniformcolormaps which are
the recommendedcolormaps for sequential data:

========= ===================================================
Colormap Description
Expand DownExpand Up@@ -2087,7 +2087,7 @@ def colormaps():
Colormap Description
========= =======================================================
autumn sequential linearly-increasing shades of red-orange-yellow
bone sequential increasing black-whitecolor map with
bone sequential increasing black-whitecolormap with
a tinge of blue, to emulate X-ray film
cool linearly-decreasing shades of cyan-magenta
copper sequential increasing shades of black-copper
Expand DownExpand Up@@ -2128,7 +2128,7 @@ def colormaps():
Language software
============ =======================================================

A set of cycliccolor maps:
A set of cycliccolormaps:

================ =================================================
Colormap Description
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp