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 0b6b385 commit 1f7e0efCopy full SHA for 1f7e0ef
lib/matplotlib/cm.py
@@ -702,5 +702,7 @@ def _ensure_cmap(cmap):
702
if isinstance(cmap, colors.Colormap):
703
return cmap
704
cmap_name = cmap if cmap is not None else mpl.rcParams["image.cmap"]
705
+ # use check_in_list to ensure type stability of the exception raised by
706
+ # the internal usage of this (ValueError vs KeyError)
707
_api.check_in_list(sorted(_colormaps), cmap=cmap_name)
708
return mpl.colormaps[cmap_name]
0 commit comments