Skip to content

Commit

Permalink
update FileIOExt
Browse files Browse the repository at this point in the history
  • Loading branch information
t-bltg committed Feb 9, 2023
1 parent c38cf1d commit 110be6d
Showing 1 changed file with 4 additions and 21 deletions.
25 changes: 4 additions & 21 deletions ext/FileIOExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,6 @@ module FileIOExt
import Plots: Plots, Plot, @ext_imp_use
@ext_imp_use :import FileIO

const PDFBackends = Union{
Plots.PythonPlotBackend,
Plots.InspectDRBackend,
Plots.PGFPlotsXBackend,
Plots.PGFPlotsBackend,
Plots.PlotlyJSBackend,
Plots.PyPlotBackend,
Plots.GRBackend,
}

_fileio_load(@nospecialize(filename::AbstractString)) =
FileIO.load(filename::AbstractString)
_fileio_save(@nospecialize(filename::AbstractString), @nospecialize(x)) =
Expand All @@ -36,18 +26,11 @@ function _show_pdfbackends(io::IO, ::MIME"image/png", plt::Plot)
end

for be in (
Plots.PythonPlotBackend,
Plots.InspectDRBackend,
Plots.PGFPlotsXBackend,
Plots.PGFPlotsBackend,
Plots.PlotlyJSBackend,
Plots.PyPlotBackend,
Plots.GRBackend,
Plots.PGFPlotsBackend, # NOTE: I guess this can be removed in Plots@2.0
)
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
showable(MIME"image/png"(), Plot{be}) && continue
@eval Plots._show(io::IO, mime::MIME"image/png", plt::Plot{$be}) =
_show_pdfbackends(io, mime, plt)
end

end # module

0 comments on commit 110be6d

Please sign in to comment.