How do I wait for a Plots.jl window to be closed?

Is there something similar to from matplotlib in Plots.jl.
I would prefer a solution for the GR backend.
Maybe a call which is waiting for all windows / gui threads to be closed?

using Plots
# somehow wait here for the gui to be closed
println("everything is closed")

I do it like this (in GR)

using Plots
f(x) = x^2
x = collect(-10:10)
y = f.(x)
p = plot(x, y, label=false, lw=1.0)
title!("f(x) = x^2")
println("\npress enter to close plot")
1 Like

This is a nice solution when the terminal is available. In my case a background process is started to execute the Julia code. Therefore I don’t have access to terminal inputs such as readline.