Skip to content

Commit 990860f

Browse files
author
Jasper van den Bosch
committed
fix workaround for get_cmap
1 parent 045d959 commit 990860f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/rsatoolbox/vis/icon.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
from rsatoolbox.rdm import RDMs
1717
from rsatoolbox.util.pooling import pool_rdm
1818
if hasattr(matplotlib.colormaps, 'get_cmap'):
19-
get_cmap = matplotlib.colormaps.get_cmap
19+
mpl_get_cmap = matplotlib.colormaps.get_cmap
2020
else:
21-
get_cmap = matplotlib.cm.get_cmap # drop:py37
21+
mpl_get_cmap = matplotlib.cm.get_cmap # drop:py37
2222

2323

2424
class Icon:
@@ -247,7 +247,7 @@ def recompute_final_image(self):
247247
else:
248248
im = self._image
249249
if self.cmap is not None:
250-
im = matplotlib.colormaps.get_cmap(self.cmap)(im)
250+
im = mpl_get_cmap(self.cmap)(im)
251251
im = PIL.Image.fromarray((im * 255).astype(np.uint8))
252252
else: # we hope it is a PIL image or equivalent
253253
im = self._image

0 commit comments

Comments
 (0)