diff --git a/examples/color/colormap_reference.py b/examples/color/colormap_reference.py index 848fc1c66090..768a155dbb16 100644 --- a/examples/color/colormap_reference.py +++ b/examples/color/colormap_reference.py @@ -5,44 +5,17 @@ Reference for colormaps included with Matplotlib. -This reference example shows all colormaps included with Matplotlib. Note that -any colormap listed here can be reversed by appending "_r" (e.g., "pink_r"). -These colormaps are divided into the following categories: - -Sequential: - These colormaps are approximately monochromatic colormaps varying smoothly - between two color tones---usually from low saturation (e.g. white) to high - saturation (e.g. a bright blue). Sequential colormaps are ideal for - representing most scientific data since they show a clear progression from - low-to-high values. - -Diverging: - These colormaps have a median value (usually light in color) and vary - smoothly to two different color tones at high and low values. Diverging - colormaps are ideal when your data has a median value that is significant - (e.g. 0, such that positive and negative values are represented by - different colors of the colormap). - -Qualitative: - These colormaps vary rapidly in color. Qualitative colormaps are useful -for - choosing a set of discrete colors. For example:: - - color_list = plt.cm.Set3(np.linspace(0, 1, 12)) - - gives a list of RGB colors that are good for plotting a series of lines on - a dark background. - -Miscellaneous: - Colormaps that don't fit into the categories above. +A reversed version of each of these colormaps is available by appending +``_r`` to the name, e.g., ``viridis_r``. +See :doc:`/tutorials/colors/colormaps` for an in-depth discussion about +colormaps, including colorblind-friendliness. """ + import numpy as np import matplotlib.pyplot as plt -# Have colormaps separated into categories: -# http://matplotlib.org/examples/color/colormaps_reference.html cmaps = [('Perceptually Uniform Sequential', [ 'viridis', 'plasma', 'inferno', 'magma']), ('Sequential', [ diff --git a/lib/matplotlib/cm.py b/lib/matplotlib/cm.py index b08b23798b55..731cc7d0d36d 100644 --- a/lib/matplotlib/cm.py +++ b/lib/matplotlib/cm.py @@ -1,8 +1,8 @@ """ -This module provides a large set of colormaps, functions for -registering new colormaps and for getting a colormap by name, -and a mixin class for adding color mapping functionality. +Builtin colormaps, colormap handling utilities, and the `ScalarMappable` mixin. +See :doc:`/gallery/color/colormap_reference` for a list of builtin colormaps. +See :doc:`/tutorials/colors/colormaps` for an in-depth discussion of colormaps. """ from __future__ import (absolute_import, division, print_function, unicode_literals)