Skip to content

Commit 494fa5c

Browse files
committed
Fix matplotlib.cm.get_cmap() deprecation warning
1 parent d6df99e commit 494fa5c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/emsarray/transect.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import shapely
1212
import xarray
1313
from cartopy import crs
14-
from matplotlib import animation, cm, pyplot
14+
from matplotlib import animation, colormaps, pyplot
1515
from matplotlib.artist import Artist
1616
from matplotlib.axes import Axes
1717
from matplotlib.collections import PolyCollection
@@ -760,7 +760,7 @@ def _plot_on_figure(
760760
if title is not None:
761761
axes.set_title(title)
762762

763-
cmap = cm.get_cmap(cmap).copy()
763+
cmap = colormaps[cmap].copy()
764764
cmap.set_bad(ocean_floor_colour)
765765
collection = self.make_poly_collection(
766766
cmap=cmap, clim=(numpy.nanmin(data_array), numpy.nanmax(data_array)))

0 commit comments

Comments
 (0)