Skip to content

Commit

Permalink
Fix #36
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Milk committed Jul 3, 2024
1 parent 5b75622 commit 229d7c5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/marsilea/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,13 @@ def relative_luminance(color):


def get_colormap(cmap):
if isinstance(cmap, Colormap):
return cmap
try:
return mpl.colormap.get(cmap)
return mpl.cm.ColormapRegistry.get_cmap(cmap)
except AttributeError:
try:
return mpl.cm.get_cmap(cmap)
return mpl.colormaps.get(cmap)
except AttributeError:
return mpl.cm.ColormapRegistry.get_cmap(cmap)
return mpl.cm.get_cmap(cmap)


def get_canvas_size_by_data(
Expand Down

0 comments on commit 229d7c5

Please sign in to comment.