From 01742cffa6d867a2e7651907c9b28e2fb2892970 Mon Sep 17 00:00:00 2001 From: Leon Wabeke Date: Wed, 2 Jan 2019 12:10:03 +0200 Subject: [PATCH] IJulia and REPL plotting seems to work again, however from REPL plot! creates a new empty window in addition to updating existing window, but only if run on a seperate line, running plot(rand(10));plot!(rand(5)) doesn't create the extra window --- src/backends/plotlyjs.jl | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/backends/plotlyjs.jl b/src/backends/plotlyjs.jl index 98e626c1..70a7c3c3 100644 --- a/src/backends/plotlyjs.jl +++ b/src/backends/plotlyjs.jl @@ -12,7 +12,9 @@ const _plotlyjs_scale = _plotly_scale function _create_backend_figure(plt::Plot{PlotlyJSBackend}) if !isplotnull() && plt[:overwrite_figure] && isa(current().o, PlotlyJS.SyncPlot) - PlotlyJS.SyncPlot(PlotlyJS.Plot(), current().o.view) + p = PlotlyJS.plot() + p.window = current().o.window + p else PlotlyJS.plot() end @@ -57,11 +59,7 @@ end # ---------------------------------------------------------------- function _show(io::IO, ::MIME"text/html", plt::Plot{PlotlyJSBackend}) - if isijulia() && !_use_remote[] - write(io, PlotlyJS.html_body(PlotlyJS.JupyterPlot(plt.o))) - else show(io, MIME("text/html"), plt.o) - end end function plotlyjs_save_hack(io::IO, plt::Plot{PlotlyJSBackend}, ext::String)