Skip to content

Commit

Permalink
rework fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
t-bltg committed Feb 8, 2023
1 parent a8c44b9 commit c38cf1d
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions ext/FileIOExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,19 @@ function _show_pdfbackends(io::IO, ::MIME"image/png", plt::Plot)
write(io, read(open(pngfn), String))
end

Plots._show(io::IO, mime::MIME"image/png", plt::Plot{<:PDFBackends}) =
_show_pdfbackends(io, mime, plt)
for be in (
Plots.PythonPlotBackend,
Plots.InspectDRBackend,
Plots.PGFPlotsXBackend,
Plots.PGFPlotsBackend,
Plots.PlotlyJSBackend,
Plots.PyPlotBackend,
Plots.GRBackend,
)
if !showable(MIME"image/png"(), Plot{be})
@eval Plots._show(io::IO, mime::MIME"image/png", plt::Plot{$be}) =
_show_pdfbackends(io, mime, plt)
end
end

end # module

0 comments on commit c38cf1d

Please sign in to comment.