Skip to content

Commit 8fb9d6a

Browse files
committed
FIX do not register colormap if already done
1 parent 45772ed commit 8fb9d6a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cortex/utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,10 @@ def get_cmap(name):
10011001
if name in colormaps:
10021002
I = plt.imread(colormaps[name])
10031003
cmap = colors.ListedColormap(np.squeeze(I))
1004-
plt.cm.register_cmap(name,cmap)
1004+
try:
1005+
plt.cm.register_cmap(name,cmap)
1006+
except:
1007+
print(f"Color map {name} is already registered.")
10051008
else:
10061009
try:
10071010
cmap = plt.cm.get_cmap(name)

0 commit comments

Comments
 (0)