From 23459b7222a9b668554aa7a5353e1326e1e1cfab Mon Sep 17 00:00:00 2001 From: Mayo Faulkner Date: Mon, 10 Jun 2024 12:00:01 +0100 Subject: [PATCH 1/2] change deprecated matplotlib cmap --- iblatlas/plots.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iblatlas/plots.py b/iblatlas/plots.py index d7c6afc..5fe69bb 100644 --- a/iblatlas/plots.py +++ b/iblatlas/plots.py @@ -302,7 +302,7 @@ def _plot_slice_vector(coords, slice, values, mapping, empty_color='silver', cle else: fig = ax.get_figure() - colormap = cm.get_cmap(cmap) + colormap = colors.get_cmap(cmap) norm = colors.Normalize(vmin=clevels[0], vmax=clevels[1]) nan_vals = np.isnan(values) rgba_color = np.full((values.size, 4), fill_value=np.nan) @@ -521,7 +521,7 @@ def plot_scalar_on_flatmap(regions, values, depth=0, flatmap='dorsal_cortex', ma d_idx = int(np.round(depth / ba.res_um)) # need to find nearest to 25 if background == 'boundary': - cmap_bound = cm.get_cmap("bone_r").copy() + cmap_bound = colors.get_cmap("bone_r").copy() cmap_bound.set_under([1, 1, 1], 0) if ax: @@ -893,7 +893,7 @@ def plot_swanson_vector(acronyms=None, values=None, ax=None, hemisphere=None, br if acronyms is not None: ibr, vals = br.propagate_down(acronyms, values) - colormap = cm.get_cmap(cmap) + colormap = colors.get_cmap(cmap) vmin = vmin or np.nanmin(vals) vmax = vmax or np.nanmax(vals) norm = colors.Normalize(vmin=vmin, vmax=vmax) From a7c6173ec85f3eb13cdc1350b18458d1b1637388 Mon Sep 17 00:00:00 2001 From: Mayo Faulkner Date: Mon, 10 Jun 2024 12:01:24 +0100 Subject: [PATCH 2/2] change log and version --- CHANGELOG.md | 4 ++++ iblatlas/__init__.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 698a043..51d7231 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [0.5.2] +### Modified +- `iblatlas.plots` uses colors.get_cmap instead of deprecated cm.get_cmap + ## [0.5.1] ### Modified - `iblatlas.genomics.merfish.load` does not return an error when dask is installed but diff --git a/iblatlas/__init__.py b/iblatlas/__init__.py index c2c34fc..5505a57 100644 --- a/iblatlas/__init__.py +++ b/iblatlas/__init__.py @@ -194,4 +194,4 @@ .. [10] Allen Mouse Common Coordinate Framework Technical White Paper (October 2017 v3) http://help.brain-map.org/download/attachments/8323525/Mouse_Common_Coordinate_Framework.pdf """ -__version__ = '0.5.1' +__version__ = '0.5.2'