Plot.jl throws "broken pipe" after closing window with gr() backend

Hi,
I am wondering whether the following is a bug or an error in my installation. I use Plots.jl with the gr() backend and do the following MWE

julia> using Plots
julia> plot(rand(4,4))

then I close the QT window with the plot and try to plot again to observe

julia> plot(rand(4,4))
send: Broken pipe

After this, the REPL is practically useless for plotting.

If instead, I used the pyplot() backend, it works [until I change to gr()]


julia> using Plots

julia> pyplot()
Plots.PyPlotBackend()

julia> plot(rand(4,4)) #close window

julia> plot(rand(4,4)) #close window

julia> plot(rand(4,4)) #close window

julia> gr()
Plots.GRBackend()

julia> plot(rand(4,4)) #close window

julia> plot(rand(4,4))
send: Broken pipe

My installation (julia 1.2 and 1.3 on linux) is up-to-date for all I know:

  [91a5bcdd] Plots v0.29.6
  [d330b81b] PyPlot v2.8.2
  [1fd47b50] QuadGK v2.3.1

Any idea what is going wrong? Especially since gr() is the default backend.
Cheers

I think @jheinen mentioned that this is fixed in the next release - for now I believe you have to restart the Julia session.

Nope, closeall() let’s you plot again.

1 Like

Indeed, closeall() is a nice workaround!

I would still be curious if this will be fixed or not in the long run? In fact, when looking at the github repository, I did not find an issue on this (maybe I looked for the wrong keywords though).

The problem is fixed in the development branch and will be tagged tomorrow.

4 Likes

Thank you all for the answers!

Thanks for asking about this - I ran into it this morning