|
5 | 5 |
|
6 | 6 | Reference for colormaps included with Matplotlib.
|
7 | 7 |
|
8 |
| -This reference example shows all colormaps included with Matplotlib. Note that |
9 |
| -any colormap listed here can be reversed by appending "_r" (e.g., "pink_r"). |
10 |
| -These colormaps are divided into the following categories: |
11 |
| -
|
12 |
| -Sequential: |
13 |
| - These colormaps are approximately monochromatic colormaps varying smoothly |
14 |
| - between two color tones---usually from low saturation (e.g. white) to high |
15 |
| - saturation (e.g. a bright blue). Sequential colormaps are ideal for |
16 |
| - representing most scientific data since they show a clear progression from |
17 |
| - low-to-high values. |
18 |
| -
|
19 |
| -Diverging: |
20 |
| - These colormaps have a median value (usually light in color) and vary |
21 |
| - smoothly to two different color tones at high and low values. Diverging |
22 |
| - colormaps are ideal when your data has a median value that is significant |
23 |
| - (e.g. 0, such that positive and negative values are represented by |
24 |
| - different colors of the colormap). |
25 |
| -
|
26 |
| -Qualitative: |
27 |
| - These colormaps vary rapidly in color. Qualitative colormaps are useful |
28 |
| -for |
29 |
| - choosing a set of discrete colors. For example:: |
30 |
| -
|
31 |
| - color_list = plt.cm.Set3(np.linspace(0, 1, 12)) |
32 |
| -
|
33 |
| - gives a list of RGB colors that are good for plotting a series of lines on |
34 |
| - a dark background. |
35 |
| -
|
36 |
| -Miscellaneous: |
37 |
| - Colormaps that don't fit into the categories above. |
| 8 | +A reversed version of each of these colormaps is available by appending |
| 9 | +``_r`` to the name, e.g., ``viridis_r``. |
38 | 10 |
|
| 11 | +See :doc:`/tutorials/colors/colormaps` for an in-depth discussion about |
| 12 | +colormaps, including colorblind-friendliness. |
39 | 13 | """
|
| 14 | + |
40 | 15 | import numpy as np
|
41 | 16 | import matplotlib.pyplot as plt
|
42 | 17 |
|
43 | 18 |
|
44 |
| -# Have colormaps separated into categories: |
45 |
| -# http://matplotlib.org/examples/color/colormaps_reference.html |
46 | 19 | cmaps = [('Perceptually Uniform Sequential', [
|
47 | 20 | 'viridis', 'plasma', 'inferno', 'magma']),
|
48 | 21 | ('Sequential', [
|
|
0 commit comments