go(plot): set Y axis' min/max dynamically
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
e1fa0f08ff
commit
0794e48530
@ -8,6 +8,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
|
|
||||||
"git.dotya.ml/wanderer/math-optim/stats"
|
"git.dotya.ml/wanderer/math-optim/stats"
|
||||||
|
"gonum.org/v1/gonum/floats"
|
||||||
"gonum.org/v1/plot"
|
"gonum.org/v1/plot"
|
||||||
"gonum.org/v1/plot/plotter"
|
"gonum.org/v1/plot/plotter"
|
||||||
"gonum.org/v1/plot/plotutil"
|
"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).
|
// mark the end of the X axis with len(iter.Results).
|
||||||
p.X.Max = float64(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))
|
pts := make(plotter.XYs, len(iter.Results))
|
||||||
|
|
||||||
// fill the plotter with datapoints.
|
// fill the plotter with datapoints.
|
||||||
|
Loading…
Reference in New Issue
Block a user