Skip to content

Commit

Permalink
only use np.min(z) if z_min is none
Browse files Browse the repository at this point in the history
  • Loading branch information
peterstangl committed Jul 30, 2020
1 parent f9b19ca commit 12ca043
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flavio/plots/plotfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,10 +662,10 @@ def contour(x, y, z, levels, z_min=None,
"different from the minimum on the grid. For better "
"precision, the actual minimum should be provided in the "
"`z_min` argument.")
z_min = np.min(z) # use minmum on the grid
elif np.min(z) < z_min:
raise ValueError("The provided minimum `z_min` has to be smaller than "
"the smallest `z` value on the grid.")
z_min = z_min or np.min(z) # use provided minimum or minmum on the grid
z = z - z_min # subtract z minimum to make value of new z minimum 0
if interpolation_factor > 1:
x = scipy.ndimage.zoom(x, zoom=interpolation_factor, order=1)
Expand Down

0 comments on commit 12ca043

Please sign in to comment.