From ea2fb139e31d234a1f9dbf71f17247ae7625204b Mon Sep 17 00:00:00 2001 From: Peter Stangl Date: Thu, 30 Jul 2020 22:14:48 +0200 Subject: [PATCH] fix zero contour issue --- flavio/plots/plotfunctions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flavio/plots/plotfunctions.py b/flavio/plots/plotfunctions.py index d9ee8163..a8d8cab7 100644 --- a/flavio/plots/plotfunctions.py +++ b/flavio/plots/plotfunctions.py @@ -687,7 +687,8 @@ def contour(x, y, z, levels, z_min=None, _contour_args.update(contour_args) _contourf_args.update(contourf_args) # for the filling, need to add zero contour - levelsf = [0] + list(levels) + zero_contour = min(np.min(z),np.min(levels)*(1-1e-16)) + levelsf = [zero_contour] + list(levels) ax = plt.gca() if filled: ax.contourf(x, y, z, levels=levelsf, **_contourf_args)