Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b9710e6

Browse files
committed
Merge pull request #5092 from cgohlke/patch-7
Generate reversed ListedColormaps
2 parents 655e109 + f3e0bfb commit b9710e6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/matplotlib/_cm_listed.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,3 +1036,6 @@
10361036
('viridis', _viridis_data)):
10371037

10381038
cmaps[name] = ListedColormap(data, name=name)
1039+
# generate reversed colormap
1040+
name = name + '_r'
1041+
cmaps[name] = ListedColormap(list(reversed(data)), name=name)

0 commit comments

Comments
 (0)