Skip to content

Commit c683c3e

Browse files
authored
Merge pull request #8928 from tacaswell/doc_tweak_pyplot_colormap_docs
DOC: tweak colormap docs in pyplot.colormaps
2 parents 209abd8 + 8967aa1 commit c683c3e

File tree

1 file changed

+59
-57
lines changed

1 file changed

+59
-57
lines changed

lib/matplotlib/pyplot.py

Lines changed: 59 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ def setp(*args, **kwargs):
361361

362362
def xkcd(scale=1, length=100, randomness=2):
363363
"""
364-
Turns on `xkcd <http://xkcd.com/>`_ sketch-style drawing mode.
364+
Turns on `xkcd <https://xkcd.com/>`_ sketch-style drawing mode.
365365
This will only have effect on things drawn after this function is
366366
called.
367367
@@ -1919,66 +1919,17 @@ def colormaps():
19191919
for nominal data that has no inherent ordering, where color is used
19201920
only to distinguish categories
19211921
1922-
The base colormaps are derived from those of the same name provided
1923-
with Matlab:
1922+
Matplotlib ships with 4 perceptually uniform color maps which are
1923+
the recommended color maps for sequential data:
19241924
1925-
========= =======================================================
1925+
========= ===================================================
19261926
Colormap Description
1927-
========= =======================================================
1928-
autumn sequential linearly-increasing shades of red-orange-yellow
1929-
bone sequential increasing black-white color map with
1930-
a tinge of blue, to emulate X-ray film
1931-
cool linearly-decreasing shades of cyan-magenta
1932-
copper sequential increasing shades of black-copper
1933-
flag repetitive red-white-blue-black pattern (not cyclic at
1934-
endpoints)
1935-
gray sequential linearly-increasing black-to-white
1936-
grayscale
1937-
hot sequential black-red-yellow-white, to emulate blackbody
1938-
radiation from an object at increasing temperatures
1939-
hsv cyclic red-yellow-green-cyan-blue-magenta-red, formed
1940-
by changing the hue component in the HSV color space
1927+
========= ===================================================
19411928
inferno perceptually uniform shades of black-red-yellow
1942-
jet a spectral map with dark endpoints, blue-cyan-yellow-red;
1943-
based on a fluid-jet simulation by NCSA [#]_
19441929
magma perceptually uniform shades of black-red-white
1945-
pink sequential increasing pastel black-pink-white, meant
1946-
for sepia tone colorization of photographs
19471930
plasma perceptually uniform shades of blue-red-yellow
1948-
prism repetitive red-yellow-green-blue-purple-...-green pattern
1949-
(not cyclic at endpoints)
1950-
spring linearly-increasing shades of magenta-yellow
1951-
summer sequential linearly-increasing shades of green-yellow
19521931
viridis perceptually uniform shades of blue-green-yellow
1953-
winter linearly-increasing shades of blue-green
1954-
========= =======================================================
1955-
1956-
For the above list only, you can also set the colormap using the
1957-
corresponding pylab shortcut interface function, similar to Matlab::
1958-
1959-
imshow(X)
1960-
hot()
1961-
jet()
1962-
1963-
The next set of palettes are from the `Yorick scientific visualisation
1964-
package <http://dhmunro.github.io/yorick-doc/>`_, an evolution of
1965-
the GIST package, both by David H. Munro:
1966-
1967-
============ =======================================================
1968-
Colormap Description
1969-
============ =======================================================
1970-
gist_earth mapmaker's colors from dark blue deep ocean to green
1971-
lowlands to brown highlands to white mountains
1972-
gist_heat sequential increasing black-red-orange-white, to emulate
1973-
blackbody radiation from an iron bar as it grows hotter
1974-
gist_ncar pseudo-spectral black-blue-green-yellow-red-purple-white
1975-
colormap from National Center for Atmospheric
1976-
Research [#]_
1977-
gist_rainbow runs through the colors in spectral order from red to
1978-
violet at full saturation (like *hsv* but not cyclic)
1979-
gist_stern "Stern special" color table from Interactive Data
1980-
Language software
1981-
============ =======================================================
1932+
========= ===================================================
19821933
19831934
The following colormaps are based on the `ColorBrewer
19841935
<http://colorbrewer2.org>`_ color specifications and designs developed by
@@ -2041,6 +1992,57 @@ def colormaps():
20411992
* Set2
20421993
* Set3
20431994
1995+
A set of colormaps derived from those of the same name provided
1996+
with Matlab are also included:
1997+
1998+
========= =======================================================
1999+
Colormap Description
2000+
========= =======================================================
2001+
autumn sequential linearly-increasing shades of red-orange-yellow
2002+
bone sequential increasing black-white color map with
2003+
a tinge of blue, to emulate X-ray film
2004+
cool linearly-decreasing shades of cyan-magenta
2005+
copper sequential increasing shades of black-copper
2006+
flag repetitive red-white-blue-black pattern (not cyclic at
2007+
endpoints)
2008+
gray sequential linearly-increasing black-to-white
2009+
grayscale
2010+
hot sequential black-red-yellow-white, to emulate blackbody
2011+
radiation from an object at increasing temperatures
2012+
hsv cyclic red-yellow-green-cyan-blue-magenta-red, formed
2013+
by changing the hue component in the HSV color space
2014+
jet a spectral map with dark endpoints, blue-cyan-yellow-red;
2015+
based on a fluid-jet simulation by NCSA [#]_
2016+
pink sequential increasing pastel black-pink-white, meant
2017+
for sepia tone colorization of photographs
2018+
prism repetitive red-yellow-green-blue-purple-...-green pattern
2019+
(not cyclic at endpoints)
2020+
spring linearly-increasing shades of magenta-yellow
2021+
summer sequential linearly-increasing shades of green-yellow
2022+
winter linearly-increasing shades of blue-green
2023+
========= =======================================================
2024+
2025+
A set of palettes from the `Yorick scientific visualisation
2026+
package <https://dhmunro.github.io/yorick-doc/>`_, an evolution of
2027+
the GIST package, both by David H. Munro are included:
2028+
2029+
============ =======================================================
2030+
Colormap Description
2031+
============ =======================================================
2032+
gist_earth mapmaker's colors from dark blue deep ocean to green
2033+
lowlands to brown highlands to white mountains
2034+
gist_heat sequential increasing black-red-orange-white, to emulate
2035+
blackbody radiation from an iron bar as it grows hotter
2036+
gist_ncar pseudo-spectral black-blue-green-yellow-red-purple-white
2037+
colormap from National Center for Atmospheric
2038+
Research [#]_
2039+
gist_rainbow runs through the colors in spectral order from red to
2040+
violet at full saturation (like *hsv* but not cyclic)
2041+
gist_stern "Stern special" color table from Interactive Data
2042+
Language software
2043+
============ =======================================================
2044+
2045+
20442046
Other miscellaneous schemes:
20452047
20462048
============= =======================================================
@@ -2101,14 +2103,14 @@ def colormaps():
21012103
21022104
.. [#] Resembles "BkBlAqGrYeOrReViWh200" from NCAR Command
21032105
Language. See `Color Table Gallery
2104-
<http://www.ncl.ucar.edu/Document/Graphics/color_table_gallery.shtml>`_
2106+
<https://www.ncl.ucar.edu/Document/Graphics/color_table_gallery.shtml>`_
21052107
21062108
.. [#] See `Diverging Color Maps for Scientific Visualization
21072109
<http://www.kennethmoreland.com/color-maps/>`_ by Kenneth Moreland.
21082110
21092111
.. [#] See `A Color Map for Effective Black-and-White Rendering of
21102112
Color-Scale Images
2111-
<http://www.mathworks.com/matlabcentral/fileexchange/2662-cmrmap-m>`_
2113+
<https://www.mathworks.com/matlabcentral/fileexchange/2662-cmrmap-m>`_
21122114
by Carey Rappaport
21132115
21142116
.. [#] Changed to distinguish from ColorBrewer's *Spectral* map.

0 commit comments

Comments
 (0)