Skip to content

Commit

Permalink
refactor(EyeVolumeVoxelAnnotation): simplify code for plotting
Browse files Browse the repository at this point in the history
  • Loading branch information
Oli4 committed Sep 15, 2022
1 parent 0339fb6 commit 355e7f6
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions eyepy/core/eyevolume.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,9 @@ def plot(
if vmax is None:
vmax = max([enface_projection.max(), vmin])

visible = np.zeros(enface_projection[region].shape)
visible[
np.logical_and(
vmin <= enface_projection[region], enface_projection[region] <= vmax
)
] = 1
enface_crop = enface_projection[region]
visible = np.zeros(enface_crop.shape)
visible[np.logical_and(vmin <= enface_crop, enface_crop <= vmax)] = 1

if cbar:
divider = make_axes_locatable(ax)
Expand All @@ -223,8 +220,8 @@ def plot(
)

ax.imshow(
enface_projection[region],
alpha=visible[region] * alpha,
enface_crop,
alpha=visible * alpha,
cmap=cmap,
vmin=vmin,
vmax=vmax,
Expand Down

0 comments on commit 355e7f6

Please sign in to comment.