From 04ad04188ad4db9ef73f99a32f1e1ab1da4225f1 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 15 Feb 2023 15:20:04 +0100 Subject: [PATCH] plot: properly label x_axis for jDE/SOMA --- algo/plot.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/algo/plot.go b/algo/plot.go index c639372..1256930 100644 --- a/algo/plot.go +++ b/algo/plot.go @@ -150,7 +150,7 @@ func PlotMeanValsMulti( mCoMPL.Unlock() } -func plotMeanVals(meanVals []float64, title string, fes int) *plot.Plot { +func plotMeanVals(meanVals []float64, title, algo string, fes int) *plot.Plot { plotter.DefaultFont.Typeface = preferredFont plotter.DefaultLineStyle.Width = vg.Points(2.0) @@ -163,7 +163,12 @@ func plotMeanVals(meanVals []float64, title string, fes int) *plot.Plot { p.Title.Text = "Mean - " + title - p.X.Label.Text = xAxisLabel + if strings.Contains(algo, "DE") || strings.Contains(algo, "SOMA") { + p.X.Label.Text = "FES" + } else { + p.X.Label.Text = xAxisLabel + } + // p.X.Label.Padding = 8 * vg.Millimeter p.X.Label.TextStyle.Font.Variant = preferredFont p.X.Label.TextStyle.Font.Weight = 1 // Medium @@ -359,7 +364,7 @@ func plotAllDims(algoStats []stats.Stats, fPrefix, fExt string, ch chan report.P picMean.FilePath = filenameMean // get the *mean* plot. - pMean := plotMeanVals(dim.MeanVals, meanTitle, s.Generations) + pMean := plotMeanVals(dim.MeanVals, meanTitle, s.Algo, s.Generations) elapsed := time.Since(start) info := fmt.Sprintf("saving img to file: %s(-Mean)%s [generated in %s]",