diff --git a/galleries/users_explain/colors/colormaps.py b/galleries/users_explain/colors/colormaps.py index a38dd2af0fc9..92b56d298976 100644 --- a/galleries/users_explain/colors/colormaps.py +++ b/galleries/users_explain/colors/colormaps.py @@ -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 ======== diff --git a/lib/matplotlib/cm.py b/lib/matplotlib/cm.py index a2cd3788114d..3911986f3673 100644 --- a/lib/matplotlib/cm.py +++ b/lib/matplotlib/cm.py @@ -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