From 65b1ce02df4a1486e1827d7a4531def5a3d372f2 Mon Sep 17 00:00:00 2001 From: surtur Date: Mon, 11 Jul 2022 21:41:05 +0200 Subject: [PATCH] go(plot): decouple extension from filename --- algo/plot.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/algo/plot.go b/algo/plot.go index dc88555..1d97421 100644 --- a/algo/plot.go +++ b/algo/plot.go @@ -99,11 +99,10 @@ func plotAllDims(algoStats []stats.Stats, fPrefix, fExt string, wg *sync.WaitGro util.SanitiseFName(dim.BenchName) + "-" + fmt.Sprint(s.Dimens) + "D-" + fmt.Sprint(s.Generations) + "G-" + - fmt.Sprint(len(dim.Solution)) + "I" + - fExt + fmt.Sprint(len(dim.Solution)) + "I" elapsed := time.Since(start) - info := "saving img to file: " + filename + + info := "saving img to file: " + filename + fExt + " [generated in " + fmt.Sprint(elapsed) + "]" if s.Algo == "Random Search" { @@ -116,7 +115,7 @@ func plotAllDims(algoStats []stats.Stats, fPrefix, fExt string, wg *sync.WaitGro if err := p.Save( pWidth, pHeight, - filename, + filename+fExt, ); err != nil { panic(err) }