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

Appearance settings

Commit 83771a5

Browse filesBrowse files
committed
@timhoffm comments
1 parent b51f6d3 commit 83771a5
Copy full SHA for 83771a5

File tree

Expand file treeCollapse file tree

1 file changed

+6
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-5
lines changed

‎examples/color/colormap_reference.py

Copy file name to clipboardExpand all lines: examples/color/colormap_reference.py
+6-5Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.