Skip to content

Commit

Permalink
color map fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mayofaulkner committed Jun 10, 2024
1 parent 9d1b8af commit 0cee727
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions iblatlas/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import numpy as np
from scipy.ndimage import gaussian_filter
from scipy.stats import binned_statistic
import matplotlib
import matplotlib.pyplot as plt
from matplotlib import cm, colors
from matplotlib.patches import Polygon, PathPatch
Expand Down Expand Up @@ -302,7 +303,7 @@ def _plot_slice_vector(coords, slice, values, mapping, empty_color='silver', cle
else:
fig = ax.get_figure()

colormap = colors.get_cmap(cmap)
colormap = matplotlib.colormaps.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 +522,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 = colors.get_cmap("bone_r").copy()
cmap_bound = matplotlib.colormaps.get_cmap("bone_r").copy()
cmap_bound.set_under([1, 1, 1], 0)

if ax:
Expand Down Expand Up @@ -893,7 +894,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 = colors.get_cmap(cmap)
colormap = matplotlib.colormaps.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 0cee727

Please sign in to comment.