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

Bugfix slicer #189

Merged
merged 3 commits into from
Jan 10, 2020
Merged
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
6 changes: 5 additions & 1 deletion discretize/View.py
Original file line number Diff line number Diff line change
Expand Up @@ -1377,7 +1377,7 @@ def __init__(self, mesh, v, xslice=None, yslice=None, zslice=None,
self.xind = np.argmin(np.abs(self.xc - xslice))
else:
self.xind = self.xc.size // 2
if xslice is not None:
if yslice is not None:
self.yind = np.argmin(np.abs(self.yc - yslice))
else:
self.yind = self.yc.size // 2
Expand All @@ -1401,6 +1401,10 @@ def __init__(self, mesh, v, xslice=None, yslice=None, zslice=None,
# Store min and max of all data
if clim is None:
clim = [np.nanmin(self.v), np.nanmax(self.v)]
# In the case of a homogeneous fullspace provide a small range to avoid
# problems with colorbar and the three subplots.
if clim[0] == clim[1]:
clim = [0.99*clim[0], 1.01*clim[1]]
self.pc_props = {'vmin': clim[0], 'vmax': clim[1]}

# 2. Start populating figure
Expand Down