|
8 | 8 | import shapely |
9 | 9 | import xarray |
10 | 10 | from cartopy import crs |
11 | | -from matplotlib import animation, colormaps, pyplot |
| 11 | +from matplotlib import animation, pyplot |
12 | 12 | from matplotlib.artist import Artist |
13 | 13 | from matplotlib.axes import Axes |
14 | 14 | from matplotlib.collections import PolyCollection |
@@ -558,7 +558,7 @@ def plot_on_figure( |
558 | 558 | trim_nans: bool = True, |
559 | 559 | clamp_to_surface: bool = True, |
560 | 560 | bathymetry: xarray.DataArray | None = None, |
561 | | - cmap: str | Colormap = 'jet', |
| 561 | + cmap: str | Colormap | None = None, |
562 | 562 | clim: tuple[float, float] | None = None, |
563 | 563 | ocean_floor_colour: str = 'black', |
564 | 564 | landmarks: list[Landmark] | None = None, |
@@ -620,7 +620,7 @@ def animate_on_figure( |
620 | 620 | trim_nans: bool = True, |
621 | 621 | clamp_to_surface: bool = True, |
622 | 622 | bathymetry: xarray.DataArray | None = None, |
623 | | - cmap: str | Colormap = 'jet', |
| 623 | + cmap: str | Colormap | None = None, |
624 | 624 | clim: tuple[float, float] | None = None, |
625 | 625 | ocean_floor_colour: str = 'black', |
626 | 626 | landmarks: list[Landmark] | None = None, |
@@ -717,7 +717,7 @@ def _plot_on_figure( |
717 | 717 | trim_nans: bool = True, |
718 | 718 | clamp_to_surface: bool = True, |
719 | 719 | bathymetry: xarray.DataArray | None = None, |
720 | | - cmap: str | Colormap = 'jet', |
| 720 | + cmap: str | Colormap | None = None, |
721 | 721 | clim: tuple[float, float] | None = None, |
722 | 722 | ocean_floor_colour: str = 'black', |
723 | 723 | landmarks: list[Landmark] | None = None, |
@@ -774,8 +774,7 @@ def _plot_on_figure( |
774 | 774 | if title is not None: |
775 | 775 | axes.set_title(title) |
776 | 776 |
|
777 | | - if isinstance(cmap, str): |
778 | | - cmap = colormaps[cmap].copy() |
| 777 | + cmap = pyplot.get_cmap(cmap).copy() |
779 | 778 | cmap.set_bad(ocean_floor_colour) |
780 | 779 |
|
781 | 780 | # Find a min/max from the data if clim isn't provided and the data array is not empty. |
|
0 commit comments