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

Skip to content

Commit 3240275

Browse files
authored
Merge pull request #27122 from meeseeksmachine/auto-backport-of-pr-26930-on-v3.8.x
Backport PR #26930 on branch v3.8.x (Added documentation on getting full list of registered colormaps re: issue #26244)
2 parents 97e8d17 + 1ed30d0 commit 3240275

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

galleries/users_explain/colors/colormaps.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
help on creating your own colormaps, see
1616
:ref:`colormap-manipulation`.
1717
18+
To get a list of all registered colormaps, you can do::
19+
20+
from matplotlib import colormaps
21+
list(colormaps)
22+
1823
Overview
1924
========
2025

lib/matplotlib/cm.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ class ColormapRegistry(Mapping):
7474
Additional colormaps can be added via `.ColormapRegistry.register`::
7575
7676
mpl.colormaps.register(my_colormap)
77+
78+
To get a list of all registered colormaps, you can do::
79+
80+
from matplotlib import colormaps
81+
list(colormaps)
7782
"""
7883
def __init__(self, cmaps):
7984
self._cmaps = cmaps

0 commit comments

Comments
 (0)