From 229d7c57e4b79bc1bf55c73105240d07167c2043 Mon Sep 17 00:00:00 2001 From: Mr-Milk Date: Wed, 3 Jul 2024 10:08:55 +0200 Subject: [PATCH] Fix #36 --- src/marsilea/utils.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/marsilea/utils.py b/src/marsilea/utils.py index a19b068..16fb67e 100644 --- a/src/marsilea/utils.py +++ b/src/marsilea/utils.py @@ -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(