We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3991dc6 commit ffb8969Copy full SHA for ffb8969
lib/matplotlib/cm.py
@@ -735,5 +735,6 @@ def _ensure_cmap(cmap):
735
cmap_name = cmap if cmap is not None else mpl.rcParams["image.cmap"]
736
# use check_in_list to ensure type stability of the exception raised by
737
# the internal usage of this (ValueError vs KeyError)
738
- _api.check_in_list(list(_colormaps), cmap=cmap_name)
+ if cmap_name not in _colormaps:
739
+ _api.check_in_list(sorted(_colormaps), cmap=cmap_name)
740
return mpl.colormaps[cmap_name]
0 commit comments