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

Skip to content

Backport PR #26930 on branch v3.8.x (Added documentation on getting full list of registered colormaps re: issue #26244) #27122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions galleries/users_explain/colors/colormaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
help on creating your own colormaps, see
:ref:`colormap-manipulation`.

To get a list of all registered colormaps, you can do::

from matplotlib import colormaps
list(colormaps)

Overview
========

Expand Down
5 changes: 5 additions & 0 deletions lib/matplotlib/cm.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ class ColormapRegistry(Mapping):
Additional colormaps can be added via `.ColormapRegistry.register`::

mpl.colormaps.register(my_colormap)

To get a list of all registered colormaps, you can do::

from matplotlib import colormaps
list(colormaps)
"""
def __init__(self, cmaps):
self._cmaps = cmaps
Expand Down