plot: properly label x_axis for jDE/SOMA
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
leo 2023-02-15 15:20:04 +01:00
parent bba409177c
commit 04ad04188a
Signed by: wanderer
SSH Key Fingerprint: SHA256:Dp8+iwKHSlrMEHzE3bJnPng70I7LEsa3IJXRH/U+idQ

@ -150,7 +150,7 @@ func PlotMeanValsMulti(
mCoMPL.Unlock() 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.DefaultFont.Typeface = preferredFont
plotter.DefaultLineStyle.Width = vg.Points(2.0) 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.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.Padding = 8 * vg.Millimeter
p.X.Label.TextStyle.Font.Variant = preferredFont p.X.Label.TextStyle.Font.Variant = preferredFont
p.X.Label.TextStyle.Font.Weight = 1 // Medium 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 picMean.FilePath = filenameMean
// get the *mean* plot. // get the *mean* plot.
pMean := plotMeanVals(dim.MeanVals, meanTitle, s.Generations) pMean := plotMeanVals(dim.MeanVals, meanTitle, s.Algo, s.Generations)
elapsed := time.Since(start) elapsed := time.Since(start)
info := fmt.Sprintf("saving img to file: %s(-Mean)%s [generated in %s]", info := fmt.Sprintf("saving img to file: %s(-Mean)%s [generated in %s]",