From 1793f7bdd9170d2f088755918f1704b3580830a7 Mon Sep 17 00:00:00 2001 From: surtur Date: Sat, 20 Aug 2022 13:42:41 +0200 Subject: [PATCH] go: speed up plotting by saving plots to .pdf --- algo/algo.go | 6 +++--- report/comparisonOfMeans.tmpl | 3 ++- report/pics.tmpl | 8 ++++++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/algo/algo.go b/algo/algo.go index c07986b..0c1ad8e 100644 --- a/algo/algo.go +++ b/algo/algo.go @@ -116,7 +116,7 @@ func PrepComparisonOfMeans(wg *sync.WaitGroup) (*report.PicList, int) { // construct plots concurrently. go PlotMeanValsMulti( - wg, dimens, iterations, bench, "plot-", ".svg", + wg, dimens, iterations, bench, "plot-", ".pdf", dimXAlgoMeanVals..., ) } @@ -164,7 +164,7 @@ func DoRandomSearch(wg *sync.WaitGroup, m *sync.Mutex) { defer close(pMeanCh) for i := range algoStats { - go plotAllDims(algoStats[i], "plot", ".svg", pCh, pMeanCh) + go plotAllDims(algoStats[i], "plot", ".pdf", pCh, pMeanCh) } pLs := []report.PicList{} @@ -227,7 +227,7 @@ func DoStochasticHillClimbing(wg *sync.WaitGroup, m *sync.Mutex) { defer close(pMeanCh) for _, algoStat := range algoStats { - go plotAllDims(algoStat, "plot", ".svg", pCh, pMeanCh) + go plotAllDims(algoStat, "plot", ".pdf", pCh, pMeanCh) } pLs := []report.PicList{} diff --git a/report/comparisonOfMeans.tmpl b/report/comparisonOfMeans.tmpl index f35a8b9..5d8ab24 100644 --- a/report/comparisonOfMeans.tmpl +++ b/report/comparisonOfMeans.tmpl @@ -14,7 +14,8 @@ \centering {{- range $j, $u := $v.Pics }} \begin{subfigure}{0.30\textwidth} - {\includesvg[scale=0.45]{ {{- printf "%s" $u.FilePath -}} }} + % using .pdf + {\includegraphics[scale=0.45]{ {{- printf "%s" $u.FilePath -}} }} \caption{ {{- printf "\\scriptsize{%s}" $u.Caption -}} } \end{subfigure} \hfill diff --git a/report/pics.tmpl b/report/pics.tmpl index a137e3b..ba70d40 100644 --- a/report/pics.tmpl +++ b/report/pics.tmpl @@ -14,7 +14,9 @@ \begin{subfigure}{0.30\textwidth} % 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 -}} }} + % {\includesvg[scale=0.45]{ {{- printf "%s" $v.FilePath -}} }} + % using .pdf + {\includegraphics[scale=0.45]{ {{- printf "%s" $v.FilePath -}} }} \caption{ {{- printf "\\scriptsize{%s}" $v.Caption -}} } \end{subfigure} \hfill @@ -22,7 +24,9 @@ {{ range $k, $w := .PicsMean }} \begin{subfigure}{0.30\textwidth} \vspace{2em} - {\includesvg[scale=0.45]{ {{- printf "%s" $w.FilePath -}} }} + % {\includesvg[scale=0.45]{ {{- printf "%s" $w.FilePath -}} }} + % using .pdf + {\includegraphics[scale=0.45]{ {{- printf "%s" $w.FilePath -}} }} \caption{ {{- printf "\\scriptsize{%s}" $w.Caption -}} } \end{subfigure} \hfill