go: speed up plotting by saving plots to .pdf
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2022-08-20 13:42:41 +02:00
parent d397137cfc
commit 1793f7bdd9
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D
3 changed files with 11 additions and 6 deletions

@ -116,7 +116,7 @@ func PrepComparisonOfMeans(wg *sync.WaitGroup) (*report.PicList, int) {
// construct plots concurrently. // construct plots concurrently.
go PlotMeanValsMulti( go PlotMeanValsMulti(
wg, dimens, iterations, bench, "plot-", ".svg", wg, dimens, iterations, bench, "plot-", ".pdf",
dimXAlgoMeanVals..., dimXAlgoMeanVals...,
) )
} }
@ -164,7 +164,7 @@ func DoRandomSearch(wg *sync.WaitGroup, m *sync.Mutex) {
defer close(pMeanCh) defer close(pMeanCh)
for i := range algoStats { for i := range algoStats {
go plotAllDims(algoStats[i], "plot", ".svg", pCh, pMeanCh) go plotAllDims(algoStats[i], "plot", ".pdf", pCh, pMeanCh)
} }
pLs := []report.PicList{} pLs := []report.PicList{}
@ -227,7 +227,7 @@ func DoStochasticHillClimbing(wg *sync.WaitGroup, m *sync.Mutex) {
defer close(pMeanCh) defer close(pMeanCh)
for _, algoStat := range algoStats { for _, algoStat := range algoStats {
go plotAllDims(algoStat, "plot", ".svg", pCh, pMeanCh) go plotAllDims(algoStat, "plot", ".pdf", pCh, pMeanCh)
} }
pLs := []report.PicList{} pLs := []report.PicList{}

@ -14,7 +14,8 @@
\centering \centering
{{- range $j, $u := $v.Pics }} {{- range $j, $u := $v.Pics }}
\begin{subfigure}{0.30\textwidth} \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 -}} } \caption{ {{- printf "\\scriptsize{%s}" $u.Caption -}} }
\end{subfigure} \end{subfigure}
\hfill \hfill

@ -14,7 +14,9 @@
\begin{subfigure}{0.30\textwidth} \begin{subfigure}{0.30\textwidth}
% note: this accomodates 3 plots a row comfortably..should the requirements % note: this accomodates 3 plots a row comfortably..should the requirements
% change, this would have to be reworked. % 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 -}} } \caption{ {{- printf "\\scriptsize{%s}" $v.Caption -}} }
\end{subfigure} \end{subfigure}
\hfill \hfill
@ -22,7 +24,9 @@
{{ range $k, $w := .PicsMean }} {{ range $k, $w := .PicsMean }}
\begin{subfigure}{0.30\textwidth} \begin{subfigure}{0.30\textwidth}
\vspace{2em} \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 -}} } \caption{ {{- printf "\\scriptsize{%s}" $w.Caption -}} }
\end{subfigure} \end{subfigure}
\hfill \hfill