Skip to content

Commit

Permalink
Merge pull request #9 from int-brain-lab/fix_cmap
Browse files Browse the repository at this point in the history
Fix cmap
  • Loading branch information
mayofaulkner authored Jun 10, 2024
2 parents cf51e88 + a7c6173 commit 9d1b8af
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion iblatlas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
6 changes: 3 additions & 3 deletions iblatlas/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 9d1b8af

Please sign in to comment.