fifty shades of show
This commit is contained in:
parent
a37d9768a0
commit
9cdc72662f
@ -59,6 +59,7 @@ function surface_to_vecs(x::AVec, y::AVec, s::Union{AMat, Surface})
|
|||||||
end
|
end
|
||||||
|
|
||||||
Base.display(pgfx_plot::PGFPlotsXPlot) = display(pgfx_plot.the_plot)
|
Base.display(pgfx_plot::PGFPlotsXPlot) = display(pgfx_plot.the_plot)
|
||||||
|
|
||||||
function Base.show(io::IO, mime::MIME, pgfx_plot::PGFPlotsXPlot)
|
function Base.show(io::IO, mime::MIME, pgfx_plot::PGFPlotsXPlot)
|
||||||
show(io::IO, mime, pgfx_plot.the_plot)
|
show(io::IO, mime, pgfx_plot.the_plot)
|
||||||
end
|
end
|
||||||
@ -284,6 +285,7 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend})
|
|||||||
end
|
end
|
||||||
pgfx_plot.is_created = true
|
pgfx_plot.is_created = true
|
||||||
end
|
end
|
||||||
|
return pgfx_plot
|
||||||
end
|
end
|
||||||
## seriestype specifics
|
## seriestype specifics
|
||||||
@inline function pgfx_series_coordinates!(sp, series, segment_opt, opt, rng)
|
@inline function pgfx_series_coordinates!(sp, series, segment_opt, opt, rng)
|
||||||
@ -791,26 +793,21 @@ function _update_plot_object(plt::Plot{PGFPlotsXBackend})
|
|||||||
plt.o(plt)
|
plt.o(plt)
|
||||||
end
|
end
|
||||||
|
|
||||||
function _show(io::IO, mime::MIME"image/svg+xml", plt::Plot{PGFPlotsXBackend})
|
for mime in ("application/pdf", "image/png", "image/svg+xml")
|
||||||
_update_plot_object(plt)
|
@eval function _show(io::IO, mime::MIME{Symbol($mime)}, plt::Plot{PGFPlotsXBackend})
|
||||||
show(io, mime, plt.o)
|
show(io, mime, plt.o.the_plot)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function _show(io::IO, mime::MIME"application/pdf", plt::Plot{PGFPlotsXBackend})
|
function _show(io::IO, mime::MIME{Symbol("application/x-tex")}, plt::Plot{PGFPlotsXBackend})
|
||||||
_update_plot_object(plt)
|
|
||||||
show(io, mime, plt.o)
|
|
||||||
end
|
|
||||||
|
|
||||||
function _show(io::IO, mime::MIME"image/png", plt::Plot{PGFPlotsXBackend})
|
|
||||||
_update_plot_object(plt)
|
|
||||||
show(io, mime, plt.o)
|
|
||||||
end
|
|
||||||
|
|
||||||
function _show(io::IO, mime::MIME"application/x-tex", plt::Plot{PGFPlotsXBackend})
|
|
||||||
_update_plot_object(plt)
|
|
||||||
PGFPlotsX.print_tex(io, plt.o.the_plot, include_preamble = plt.attr[:tex_output_standalone])
|
PGFPlotsX.print_tex(io, plt.o.the_plot, include_preamble = plt.attr[:tex_output_standalone])
|
||||||
end
|
end
|
||||||
|
|
||||||
function _display(plt::Plot{PGFPlotsXBackend})
|
Base.show(io::IO, ::MIME{Symbol("text/plain")}, plt::Plot{PGFPlotsXBackend}) = show(io, plt)
|
||||||
plt.o
|
|
||||||
|
function Base.show(io::IO, plt::Plot{PGFPlotsXBackend}) display(PGFPlotsX.PGFPlotsXDisplay(), plt.o.the_plot)
|
||||||
|
end
|
||||||
|
|
||||||
|
function _display(plt::Plot{PGFPlotsXBackend})
|
||||||
|
display(PGFPlotsX.PGFPlotsXDisplay(), plt.o.the_plot)
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user