How to hold plotting window?

Hi,
Given this code :

using Plots
pyplot()
default(show = true)

plot(rand(3))
plot(rand(5))

The first plot is instantly overloaded by the second one. How to pause the execution as long as the window is not closed?

Thanks
Ghislain

add an exclamation mark at the end of the second plot function:

using Plots
pyplot()
default(show = true)

plot(rand(3))
plot!(rand(5))

Or if you want to create the second plot in a different window, use reuse=false:

using Plots; pyplot()

plot(rand(3))
plot(rand(5), reuse=false)

But if your question is how to pause execution until the first plot is closed, I have no idea.

2 Likes

Thanks guys for the fast reply!
I knew the plot! command but I missed the reuse option.
I don’t need to pause execution if I have several windows.