diff --git a/algo/plot.go b/algo/plot.go index 6b30949..3f9f431 100644 --- a/algo/plot.go +++ b/algo/plot.go @@ -6,6 +6,7 @@ package algo import ( "fmt" "log" + "strings" "time" "git.dotya.ml/wanderer/math-optim/report" @@ -180,9 +181,9 @@ func plotAllDims(algoStats []stats.Stats, fPrefix, fExt string, ch chan report.P picMean := report.NewPic() meanTitle := "D: " + fmt.Sprint(s.Dimens) + ", G: " + fmt.Sprint(s.Generations) + ", I: " + fmt.Sprint(s.Iterations) - // picMean.Caption = "D:~" + fmt.Sprint(s.Dimens) + ", G:~" + - // fmt.Sprint(s.Generations) + ", I:~" + fmt.Sprint(s.Iterations) - picMean.Caption = "" + + // this is latex-rendered. + picMean.Caption = "Mean - " + strings.ReplaceAll(meanTitle, " ", "~") // set pic file path (later used in tmpl generation) pic.FilePath = filename diff --git a/report/pics.tmpl b/report/pics.tmpl index 427aa78..a137e3b 100644 --- a/report/pics.tmpl +++ b/report/pics.tmpl @@ -15,6 +15,7 @@ % note: this accomodates 3 plots a row comfortably..should the requirements % change, this would have to be reworked. {\includesvg[scale=0.45]{ {{- printf "%s" $v.FilePath -}} }} + \caption{ {{- printf "\\scriptsize{%s}" $v.Caption -}} } \end{subfigure} \hfill {{- end -}} @@ -22,9 +23,11 @@ \begin{subfigure}{0.30\textwidth} \vspace{2em} {\includesvg[scale=0.45]{ {{- printf "%s" $w.FilePath -}} }} + \caption{ {{- printf "\\scriptsize{%s}" $w.Caption -}} } \end{subfigure} \hfill {{- end }} + \caption{ {{- printf "%s - %s" .Algo .Bench -}} } \end{figure} % vim: ft=gotexttmpl.tex ts=2 sts=2 sw=2 bs=2 expandtab diff --git a/report/report_base.tmpl b/report/report_base.tmpl index 1b158ba..0994312 100644 --- a/report/report_base.tmpl +++ b/report/report_base.tmpl @@ -16,7 +16,8 @@ \usepackage{graphicx} \usepackage{textcomp} \usepackage{hyperref} -\usepackage{subcaption} % for subcaption +\usepackage[list=true]{subcaption} % for subfigures +\setcounter{lofdepth}{2} % we want subfigures in the list of figures \usepackage{sansmath} \sansmath \usepackage{svg}