Skip to content

Commit

Permalink
#535 fix regisetr colornaps again
Browse files Browse the repository at this point in the history
  • Loading branch information
akorosov committed Dec 16, 2024
1 parent 043d95a commit 728c815
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions nansat/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,13 @@ def register_colormaps():
(1, 0.5, 0.5,)],
}
}
if MATPLOTLIB_IS_INSTALLED:
for name, colormap in colormaps.items():
if name not in matplotlib.colormaps:
if 'register' in dir(cm):
cm.register(LinearSegmentedColormap(name, colormap, 256), name=name)
elif 'register_cmap' in dir(cm):
cm.register_cmap(cmap=LinearSegmentedColormap(name, colormap, 256))

def initial_bearing(lon1, lat1, lon2, lat2):
"""Initial bearing when traversing from point1 (lon1, lat1)
Expand Down

0 comments on commit 728c815

Please sign in to comment.