From bd9e8a8b0f6aecccbc8fd40565a39cba18bdcee6 Mon Sep 17 00:00:00 2001 From: "Steven G. Johnson" Date: Fri, 5 Jul 2024 15:29:30 -0400 Subject: [PATCH] check for matplotlibs.colormaps before matplotlibs.colormaps.register --- src/colormaps.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/colormaps.jl b/src/colormaps.jl index 6fc6cf4..d53e9ea 100644 --- a/src/colormaps.jl +++ b/src/colormaps.jl @@ -49,7 +49,7 @@ function init_colormaps() PythonCall.pycopy!(LinearSegmentedColormap, colorsm.LinearSegmentedColormap) PythonCall.pycopy!(cm_get_cmap, pyhasattr(pyplot, "get_cmap") ? pyplot.get_cmap : cm.get_cmap) - PythonCall.pycopy!(cm_register_cmap, pyhasattr(matplotlib.colormaps, "register") ? matplotlib.colormaps.register : cm.register_cmap) + PythonCall.pycopy!(cm_register_cmap, pyhasattr(matplotlib, "colormaps") && pyhasattr(matplotlib.colormaps, "register") ? matplotlib.colormaps.register : cm.register_cmap) PythonCall.pycopy!(ScalarMappable, cm.ScalarMappable) PythonCall.pycopy!(Normalize01, pycall(colorsm.Normalize; vmin=0,vmax=1))