Skip to content

Commit 83771a5

Browse files
committed
@timhoffm comments
1 parent b51f6d3 commit 83771a5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

examples/color/colormap_reference.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
66
Reference for colormaps included with Matplotlib.
77
8+
A reversed version of each of these colormaps is available by appending
9+
``_r`` to the name, as illustrated in :ref:`reverse-cmap`.
10+
811
See :doc:`/tutorials/colors/colormaps` for an in-depth discussion about
912
colormaps, including colorblind-friendliness.
1013
"""
@@ -64,15 +67,13 @@ def plot_color_gradients(cmap_category, cmap_list):
6467

6568

6669
###############################################################################
70+
# .. _reverse-cmap:
6771
# Reversing a colormap
6872
# --------------------
6973
#
70-
# A reversed version of any colormap is available by appending ``_r`` to the
71-
# name, for example:
74+
# A colormap can be reversed by appending ``_r`` to the name. For example:
7275

73-
plot_color_gradients("Reversed ",
74-
['viridis_r', 'Greys_r', 'PiYG_r',
75-
'twilight_r', 'Pastel1_r', 'ocean_r'])
76+
plot_color_gradients("Original and reversed ", ['viridis', 'viridis_r'])
7677

7778
#############################################################################
7879
#

0 commit comments

Comments
 (0)