Skip to content

Commit

Permalink
Fix call to register EK500 colormap (OSOceanAcoustics#1068)
Browse files Browse the repository at this point in the history
* update mpl.cm.register_cmap with matplotlib.colormaps.register

* pin matplotlib to >=3.7
  • Loading branch information
leewujung authored and lsetiawan committed Jul 28, 2023
1 parent b4b642f commit f51ebfb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions echopype/visualize/cm.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def _create_cmap(rgb, under=None, over=None):

if 'over' in colors_d:
reg_map.set_over(colors_d['over'])
mpl.cm.register_cmap(cmap=reg_map)
mpl.colormaps.register(cmap=reg_map)

# Register the reversed map
reg_map_r = mpl.colors.ListedColormap(
Expand All @@ -79,7 +79,7 @@ def _create_cmap(rgb, under=None, over=None):

if 'over' in colors_d:
reg_map_r.set_under(colors_d['over'])
mpl.cm.register_cmap(cmap=reg_map_r)
mpl.colormaps.register(cmap=reg_map_r)

# make colormaps available to call
locals().update(cmap_d)
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ setup_requires =

[options.extras_require]
plot =
matplotlib
matplotlib>=3.7
cmocean

0 comments on commit f51ebfb

Please sign in to comment.