From e9b3208d41cba522625f111193252fd727933604 Mon Sep 17 00:00:00 2001 From: t-bltg <13423344+t-bltg@users.noreply.github.com> Date: Sat, 31 Jul 2021 18:59:49 +0200 Subject: [PATCH] Gaston: typo on eval _show --- src/backends/gaston.jl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/backends/gaston.jl b/src/backends/gaston.jl index 0affbc3f..1bd138ff 100644 --- a/src/backends/gaston.jl +++ b/src/backends/gaston.jl @@ -66,15 +66,15 @@ for (mime, term) ∈ ( "image/eps" => "epslatex", "application/pdf" => "pdfcairo", "application/postscript" => "postscript", - "image/png" => "pngcairo", + "image/png" => "png", "image/svg+xml" => "svg", "text/latex" => "tikz", "application/x-tex" => "epslatex", "text/plain" => "dumb", ) @eval function _show(io::IO, ::MIME{Symbol($mime)}, plt::Plot{GastonBackend}) - tmpfile = "$(Gaston.tempname()).$term" - Gaston.save(term=$term, output=tmpfile, handle=plt.o.handle, saveopts=gaston_saveopts(plt)) + term = String($term); tmpfile = "$(Gaston.tempname()).$term" + Gaston.save(term=term, output=tmpfile, handle=plt.o.handle, saveopts=gaston_saveopts(plt)) while !isfile(tmpfile) end # avoid race condition with read in next line write(io, read(tmpfile)) rm(tmpfile, force=true) @@ -95,6 +95,8 @@ function gaston_saveopts(plt::Plot{GastonBackend}) # Scale all plot elements to match Plots.jl DPI standard scaling = plt.attr[:dpi] / Plots.DPI saveopts *= "fontscale $scaling lw $scaling dl $scaling ps $scaling" + + return saveopts end function gaston_get_subplots(n, plt_subplots, layout)