Gaston: typo on eval _show
This commit is contained in:
parent
77a9fe3b47
commit
e9b3208d41
@ -66,15 +66,15 @@ for (mime, term) ∈ (
|
|||||||
"image/eps" => "epslatex",
|
"image/eps" => "epslatex",
|
||||||
"application/pdf" => "pdfcairo",
|
"application/pdf" => "pdfcairo",
|
||||||
"application/postscript" => "postscript",
|
"application/postscript" => "postscript",
|
||||||
"image/png" => "pngcairo",
|
"image/png" => "png",
|
||||||
"image/svg+xml" => "svg",
|
"image/svg+xml" => "svg",
|
||||||
"text/latex" => "tikz",
|
"text/latex" => "tikz",
|
||||||
"application/x-tex" => "epslatex",
|
"application/x-tex" => "epslatex",
|
||||||
"text/plain" => "dumb",
|
"text/plain" => "dumb",
|
||||||
)
|
)
|
||||||
@eval function _show(io::IO, ::MIME{Symbol($mime)}, plt::Plot{GastonBackend})
|
@eval function _show(io::IO, ::MIME{Symbol($mime)}, plt::Plot{GastonBackend})
|
||||||
tmpfile = "$(Gaston.tempname()).$term"
|
term = String($term); tmpfile = "$(Gaston.tempname()).$term"
|
||||||
Gaston.save(term=$term, output=tmpfile, handle=plt.o.handle, saveopts=gaston_saveopts(plt))
|
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
|
while !isfile(tmpfile) end # avoid race condition with read in next line
|
||||||
write(io, read(tmpfile))
|
write(io, read(tmpfile))
|
||||||
rm(tmpfile, force=true)
|
rm(tmpfile, force=true)
|
||||||
@ -95,6 +95,8 @@ function gaston_saveopts(plt::Plot{GastonBackend})
|
|||||||
# Scale all plot elements to match Plots.jl DPI standard
|
# Scale all plot elements to match Plots.jl DPI standard
|
||||||
scaling = plt.attr[:dpi] / Plots.DPI
|
scaling = plt.attr[:dpi] / Plots.DPI
|
||||||
saveopts *= "fontscale $scaling lw $scaling dl $scaling ps $scaling"
|
saveopts *= "fontscale $scaling lw $scaling dl $scaling ps $scaling"
|
||||||
|
|
||||||
|
return saveopts
|
||||||
end
|
end
|
||||||
|
|
||||||
function gaston_get_subplots(n, plt_subplots, layout)
|
function gaston_get_subplots(n, plt_subplots, layout)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user