Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cmap #9

Merged
merged 2 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading