Skip to content

Commit

Permalink
Fix slicer re #363
Browse files Browse the repository at this point in the history
  • Loading branch information
prisae authored Jul 29, 2024
1 parent 300b64a commit 4a37b43
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions discretize/mixins/mpl_mod.py
Original file line number Diff line number Diff line change
Expand Up @@ -2568,6 +2568,11 @@ def __init__(
clim[0] *= 0.99
clim[1] *= 1.01

# Edge-case. If the entire vector is zero, `clim` is still
# [0, 0] after the above check, hence `clim[0]==clim[1]`.
if clim[0] == clim[1]:
clim = [-0.1, 0.1]

Check warning on line 2574 in discretize/mixins/mpl_mod.py

View check run for this annotation

Codecov / codecov/patch

discretize/mixins/mpl_mod.py#L2574

Added line #L2574 was not covered by tests

# ensure vmin/vmax of the norm is consistent with clim
if "norm" in self.pc_props:
self.pc_props["norm"].vmin = clim[0]
Expand Down

0 comments on commit 4a37b43

Please sign in to comment.