go(plot): set Y axis' min/max dynamically
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2022-07-08 03:32:07 +02:00
parent e1fa0f08ff
commit 0794e48530
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

@ -8,6 +8,7 @@ import (
"log"
"git.dotya.ml/wanderer/math-optim/stats"
"gonum.org/v1/gonum/floats"
"gonum.org/v1/plot"
"gonum.org/v1/plot/plotter"
"gonum.org/v1/plot/plotutil"
@ -52,6 +53,9 @@ func plotAllDims(allStats []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)
pts := make(plotter.XYs, len(iter.Results))
// fill the plotter with datapoints.