From 79ed004754da38ddc4115def5d6e03916ad794c8 Mon Sep 17 00:00:00 2001 From: surtur Date: Fri, 8 Jul 2022 19:04:05 +0200 Subject: [PATCH] go(plot): set proper global min for axis label --- algo/plot.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/algo/plot.go b/algo/plot.go index 8312a7e..aa8a8d3 100644 --- a/algo/plot.go +++ b/algo/plot.go @@ -53,8 +53,13 @@ func plotAllDims(algoStats []stats.Stats, fPrefix, fExt string) { // mark the end of the X axis with len(iter.Results). p.X.Max = float64(len(iter.Results)) - p.Y.Min = floats.Min(iter.Results) - p.Y.Max = floats.Max(iter.Results) + if floats.Min(iter.Results) < p.Y.Min { + p.Y.Min = floats.Min(iter.Results) + } + + if floats.Max(iter.Results) > p.Y.Max { + p.Y.Max = floats.Max(iter.Results) + } pts := make(plotter.XYs, len(iter.Results))