You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
colorize.mpl_setdefault breaks if a colormap is already registered in matplotlib. For example, I was using colorize.mpl_setdefault('planck'), causing the error ValueError: A colormap named "planck" is already registered.
What I Did
I modified the colorize.mpl_register function with a try/except block:
for name in names:
cmap = to_mpl_colormap(name, schemes[name])
try:
matplotlib.cm.register_cmap(name, cmap)
except:
pass
The text was updated successfully, but these errors were encountered:
sgiardie
changed the title
matplotlib breaks if colormap already registered, problem in colorize
matplotlib gives error if colormap already registered, problem in colorize
Feb 21, 2023
Description
colorize.mpl_setdefault
breaks if a colormap is already registered in matplotlib. For example, I was usingcolorize.mpl_setdefault('planck')
, causing the errorValueError: A colormap named "planck" is already registered.
What I Did
I modified the
colorize.mpl_register
function with a try/except block:The text was updated successfully, but these errors were encountered: