From 28a1411e68ee58e2953eefc655c27bb83ea51e20 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (o)" <j.wuttke@fz-juelich.de> Date: Wed, 28 Jun 2017 14:25:31 +0200 Subject: [PATCH] deal with rounding error in 2D y limits --- pub/lib/plot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pub/lib/plot.cpp b/pub/lib/plot.cpp index 95f7fff0..a95f6353 100644 --- a/pub/lib/plot.cpp +++ b/pub/lib/plot.cpp @@ -562,7 +562,7 @@ namespace { if (plot->Y.logflag && !(std::isfinite(yinf) && std::isfinite(ysup))) throw "No nonzero y values"; if (!plot->Y.finite()) - plot->Y.set_limits(yinf, ysup); + plot->Y.set_limits(yinf-1e-4*std::abs(yinf), ysup+1e-4*std::abs(ysup)); // plot plot->start_frame2D("Frida version " VERSION); for (size_t j=0; j<m; ++j) { -- GitLab