Skip to content

Commit f828f1e

Browse files
wemi3meeseeksmachine
authored andcommitted
Backport PR matplotlib#26930: Added documentation on getting full list of registered colormaps re: issue matplotlib#26244
1 parent da2f9e2 commit f828f1e

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

‎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)