go(algo/plot.go): set label,legend text style
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2022-07-05 22:56:01 +02:00
parent 54c01dc616
commit b6e7e916ce
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

@ -14,6 +14,8 @@ import (
"gonum.org/v1/plot/vg"
)
const preferredFontStyle = "Mono"
func plotAllDims(allStats []stats.Stats, fPrefix, fExt string) {
pWidth := 13 * vg.Centimeter
pHeight := 13 * vg.Centimeter
@ -25,8 +27,18 @@ func plotAllDims(allStats []stats.Stats, fPrefix, fExt string) {
", G=" + fmt.Sprint(s.Generations) +
", I=" + fmt.Sprint(s.Iterations)
p.X.Label.Text = "Generations"
p.X.Label.TextStyle.Font.Variant = preferredFontStyle
p.X.Label.TextStyle.Font.Weight = 1 // Medium
p.Y.Label.Text = "CF value"
p.Y.Label.TextStyle.Font.Variant = preferredFontStyle
p.Y.Label.TextStyle.Font.Weight = 1 // Medium
p.Title.TextStyle.Font.Size = 12.5
p.Title.TextStyle.Font.Weight = 2 // SemiBold
p.Title.Padding = 10 * vg.Millimeter
p.Legend.TextStyle.Font.Variant = preferredFontStyle
p.Legend.TextStyle.Font.Size = 8
p.Legend.Top = true
p.Legend.Padding = 0 * vg.Centimeter
p.Add(plotter.NewGrid())