Skip to content

Commit c26feef

Browse files
authored
check for matplotlibs.colormaps before matplotlibs.colormaps.register (#40)
1 parent aff0598 commit c26feef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/colormaps.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function init_colormaps()
4949
PythonCall.pycopy!(LinearSegmentedColormap, colorsm.LinearSegmentedColormap)
5050

5151
PythonCall.pycopy!(cm_get_cmap, pyhasattr(pyplot, "get_cmap") ? pyplot.get_cmap : cm.get_cmap)
52-
PythonCall.pycopy!(cm_register_cmap, pyhasattr(matplotlib.colormaps, "register") ? matplotlib.colormaps.register : cm.register_cmap)
52+
PythonCall.pycopy!(cm_register_cmap, pyhasattr(matplotlib, "colormaps") && pyhasattr(matplotlib.colormaps, "register") ? matplotlib.colormaps.register : cm.register_cmap)
5353

5454
PythonCall.pycopy!(ScalarMappable, cm.ScalarMappable)
5555
PythonCall.pycopy!(Normalize01, pycall(colorsm.Normalize; vmin=0,vmax=1))

0 commit comments

Comments
 (0)