Skip to content

Commit c229e30

Browse files
authored
check for matplotlibs.colormaps before matplotlibs.colormaps.register (#592)
1 parent 28826e0 commit c229e30

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
@@ -55,7 +55,7 @@ function init_colormaps()
5555
copy!(LinearSegmentedColormap, colorsm."LinearSegmentedColormap")
5656

5757
copy!(cm_get_cmap, haskey(plt, "get_cmap") ? plt."get_cmap" : cm."get_cmap")
58-
copy!(cm_register_cmap, haskey(matplotlib.colormaps, "register") ? matplotlib.colormaps."register" : cm."register_cmap")
58+
copy!(cm_register_cmap, haskey(matplotlib, "colormaps") && haskey(matplotlib."colormaps", "register") ? matplotlib."colormaps"."register" : cm."register_cmap")
5959

6060
copy!(ScalarMappable, cm."ScalarMappable")
6161
copy!(Normalize01, pycall(colorsm."Normalize",PyAny,vmin=0,vmax=1))

0 commit comments

Comments
 (0)