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 8500879

Browse filesBrowse files
authored
Added documentation on getting full list of registered colormaps re: issue #26244 (#26930)
* closes #26244, added documentation on getting full list of registered colormaps
1 parent c1482d5 commit 8500879
Copy full SHA for 8500879

File tree

Expand file treeCollapse file tree

2 files changed

+10
-0
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+10
-0
lines changed

‎galleries/users_explain/colors/colormaps.py

Copy file name to clipboardExpand all lines: galleries/users_explain/colors/colormaps.py
+5Lines 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

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