# Julia Plots.jl with plotlyJS backend pauses on every call to savefig

**URL:** <https://discourse.julialang.org/t/julia-plots-jl-with-plotlyjs-backend-pauses-on-every-call-to-savefig/2787>\
**Category:** Visualization\
**Tags:** plotting\
**Created:** [March 21, 2017, 5:45am UTC](https://discourse.julialang.org/t/julia-plots-jl-with-plotlyjs-backend-pauses-on-every-call-to-savefig/2787 "2017-03-21T05:45:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![colintbowers](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/colintbowers/32/8033_2.png) [@colintbowers](https://discourse.julialang.org/u/colintbowers)\
**Post date:** [March 21, 2017, 5:45am UTC](https://discourse.julialang.org/t/julia-plots-jl-with-plotlyjs-backend-pauses-on-every-call-to-savefig/2787/1 "2017-03-21T05:45:35Z")

</div>

Hi all,

I’m getting the following issue when attempting to use `savefig()` with the `Plots.jl` package and `plotlyjs()` backend (note, Julia v0.5.0, Plots.jl v0.10.3, PlotlyJS.jl v0.5.2, Blink v0.5.1, on Ubuntu 16.04) . Oddly enough, I am able to successfully save a plot to .png, but the REPL pauses during the save operation with the below text. If I hit enter, I get back to a new line in the REPL and the plot has saved. So from a user perspective, the only issue is that I can’t set something to run and save plots while I move away from the keyboard, since I’ll need to hit enter every time a new plot is saved. So, I open Julia at the REPL and run the following commands:

> julia\> using Plots

> julia\> plotlyjs()  
> Plots.PlotlyJSBackend()

> julia\> p = plot(randn(10));

> julia\> savefig(p, “/home/colin/Temp/myplot.png”)

The following text is displayed the _first_ time I run `savefig` (as above):

> WARNING: bytestring(s::AbstractString…) is deprecated, use string(s…) instead.  
> WARNING: the no-op `transpose` fallback is deprecated, and no more specific `transpose` method for ArgumentError exists. Consider `permutedims(x, [2, 1])` or writing a specific `transpose(x::ArgumentError)` method if appropriate. in  
> depwarn in (depwarn::(String, ::String, ::Symbol)::Symbol) at ./deprecated.jl:64  
> at in ./deprecated.jlbytestring:(64  
> :: in Stringtranspose)( at ./deprecated.jl:50  
> :: in ArgumentErrorhandle\_new\_from\_data)( at ./deprecated.jl:770  
> :: in Stringws\_handler, (::Gtk.GLib.GError)::Dict{Any,Any}) at /home/colin/.julia/v0.5/Rsvg/src/calls.jl:61  
> at in /home/colin/.julia/v0.5/Blink/src/content/server.jlhandle\_new\_from\_data:(45  
> :: in Stringsplitquery)( at /home/colin/.julia/v0.5/Rsvg/src/calls.jl:69  
> :: in Blink#savefig#175.(#ws\_handler, ::Symbol, ::Dict{Any,Any})::Function, at /home/colin/.julia/v0.5/Mux/src/basics.jl:28  
> :: in PlotlyJSwcatch.(SyncPlot{PlotlyJS.ElectronDisplay}, ::Mux.##1#2{Mux.#splitquery,Blink.#ws\_handler}, ::String)::Dict{Any,Any}) at /home/colin/.julia/v0.5/PlotlyJS/src/savefig.jl:164  
> at in /home/colin/.julia/v0.5/Mux/src/websockets\_integration.jlsavefig:(12  
> :: in PlotlyJS.SyncPlot{PlotlyJS.ElectronDisplay}, (::Mux.##1#2{Mux.##3#4{Mux.##3#4{Mux.#todict,Mux.#wcatch},Mux.#splitquery},Blink.#ws\_handler})(::String)::Tuple{HttpCommon.Request,WebSockets.WebSocket}) at /home/colin/.julia/v0.5/PlotlyJS/src/savefig.jl:106  
> at in /home/colin/.julia/v0.5/Mux/src/Mux.jlplotlyjs\_save\_hack:10  
> at in /home/colin/.julia/v0.5/Plots/src/backends/plotlyjs.jl:98 [inlined](::  
> Mux in .\_show##13#14{Mux.App})( at /home/colin/.julia/v0.5/Plots/src/backends/plotlyjs.jl:101 [inlined]::  
> HttpCommon in .showRequest(, ::IOStream, ::WebSockets.WebSocket)::MIME{Symbol(“image/png”)}, at /home/colin/.julia/v0.5/Mux/src/server.jl:38  
> :: in Plotshandle.(Plot{Plots.PlotlyJSBackend})::WebSockets.WebSocketHandler, at /home/colin/.julia/v0.5/Plots/src/output.jl:197  
> :: in HttpCommonpng.(Request, ::Plots.Plot{Plots.PlotlyJSBackend}, ::HttpServer.Client{TCPSocket})::String) at /home/colin/.julia/v0.5/WebSockets/src/WebSockets.jl:382  
> at in /home/colin/.julia/v0.5/Plots/src/output.jl:8  
> (:: in HttpServersavefig.(#on\_message\_complete#18{HttpServer.Server,HttpServer.Client{TCPSocket},Bool})(::Plots.Plot{Plots.PlotlyJSBackend}, ::HttpCommon.Request)::String) at /home/colin/.julia/v0.5/HttpServer/src/HttpServer.jl:420  
> at in /home/colin/.julia/v0.5/Plots/src/output.jlon\_message\_complete:(116  
> :: in Ptreval{(HttpParser.Parser})::Module, at /home/colin/.julia/v0.5/HttpServer/src/RequestParser.jl:113  
> :: in Anyhttp\_parser\_execute)( at ./boot.jl:234  
> :: in HttpParsereval\_user\_input.(Parser, ::Any, ::HttpParser.ParserSettings, ::Base.REPL.REPLBackend)::Array{UInt8,1}) at ./REPL.jl:64  
> at in /home/colin/.julia/v0.5/HttpParser/src/HttpParser.jlmacro expansion:115  
> at in ./REPL.jlprocess\_client:(95 [inlined]::  
> HttpServer in .Server, (::Base.REPL.##3#4{Base.REPL.REPLBackend})(::)HttpServer.Client{TCPSocket}, at ./event.jl:68  
> while loading no file, in expression starting on line 0::  
> Bool)  
> julia\> 389  
> in (::HttpServer.##8#10{HttpServer.Server,Bool})() at ./task.jl:360  
> while loading no file, in expression starting on line 0  
> Error handling websocket connection:  
> MethodError: no method matching \*(::ArgumentError, ::Blink.#msg)  
> Closest candidates are:  
> \*(::Any, ::Any, ::Any, ::Any…) at operators.jl:138

Any subsequent calls to `savefig` will pause, but with the (greatly reduced) following text:

> julia\> no method matching \*(::ArgumentError, ::Blink.#msg)  
> Closest candidates are:  
> \*(::Any, ::Any, ::Any, ::Any…) at operators.jl:138

and, as with the first call, I can just hit enter and then get returned to a new line in the console and the plot has successfully saved.

Does anyone have any ideas about how I can resolve this? Even information on whether this a problem specific to my installation, or something affecting multiple users would be helpful.

Thanks in advance.

Colin

---

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [March 21, 2017, 6:54am UTC](https://discourse.julialang.org/t/julia-plots-jl-with-plotlyjs-backend-pauses-on-every-call-to-savefig/2787/2 "2017-03-21T06:54:41Z")

</div>

It looks like the warning is from Rsvg - what is your version of that? (I have 0.0.2)

---

<div class="post-metadata">

**Author:** ![lobingera](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lobingera/32/211_2.png) [@lobingera](https://discourse.julialang.org/u/lobingera)\
**Post date:** [March 21, 2017, 9:12am UTC](https://discourse.julialang.org/t/julia-plots-jl-with-plotlyjs-backend-pauses-on-every-call-to-savefig/2787/3 "2017-03-21T09:12:51Z")

</div>

You are right, there is a deprecation warning from Rsvgs usage of bytestring which shows up in 0.5, and this should be solved by proper Compat inclusion in Rsvg (which is needed anyway for 0.6).

But still, why does a deprecation warning slow down the call?

---

<div class="post-metadata">

**Author:** ![colintbowers](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/colintbowers/32/8033_2.png) [@colintbowers](https://discourse.julialang.org/u/colintbowers)\
**Post date:** [March 22, 2017, 12:50am UTC](https://discourse.julialang.org/t/julia-plots-jl-with-plotlyjs-backend-pauses-on-every-call-to-savefig/2787/4 "2017-03-22T00:50:27Z")

</div>

Thanks for responding. I’m on Rsvg 0.0.2 also.

---

<div class="post-metadata">

**Author:** ![colintbowers](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/colintbowers/32/8033_2.png) [@colintbowers](https://discourse.julialang.org/u/colintbowers)\
**Post date:** [March 22, 2017, 12:52am UTC](https://discourse.julialang.org/t/julia-plots-jl-with-plotlyjs-backend-pauses-on-every-call-to-savefig/2787/5 "2017-03-22T00:52:14Z")

</div>

Thanks for responding. Is the implication that this problem will likely be fixed in v0.6? If so, I guess it is probably most optimal to just wait it out rather than wasting time troubleshooting, since my understanding is the stable v0.6 is fairly close…
