diff --git a/src/backends/plotly.jl b/src/backends/plotly.jl index 30d0c05c..64c9f21d 100644 --- a/src/backends/plotly.jl +++ b/src/backends/plotly.jl @@ -922,15 +922,6 @@ end # ---------------------------------------------------------------- -function _show(io::IO, ::MIME"image/png", plt::Plot{PlotlyBackend}) - # show_png_from_html(io, plt) - error("png output from the plotly backend is not supported. Please use plotlyjs instead.") -end - -function _show(io::IO, ::MIME"image/svg+xml", plt::Plot{PlotlyBackend}) - error("svg output from the plotly backend is not supported. Please use plotlyjs instead.") -end - function Base.show(io::IO, ::MIME"text/html", plt::Plot{PlotlyBackend}) prepare_output(plt) write(io, html_head(plt) * html_body(plt)) diff --git a/src/output.jl b/src/output.jl index 6344ba9c..e4b7e657 100644 --- a/src/output.jl +++ b/src/output.jl @@ -195,10 +195,11 @@ function Base.show(io::IO, ::MIME"text/html", plt::Plot) end end -function _show(io::IO, m, plt::Plot{B}) where B - # Base.show_backtrace(STDOUT, backtrace()) - warn("_show is not defined for this backend. m=", string(m)) +# delegate mimewritable (showable on julia 0.7) to _show instead +function Base.mimewritable(m::M, plt::P) where {M<:MIME, P<:Plot} + return method_exists(_show, Tuple{IO, M, P}) end + function _display(plt::Plot) warn("_display is not defined for this backend.") end