Display mutiple plots (without subplots) through Julia's console

Hello !

I have to display 3 different plots (without using subplot) trought the console but it only shows the last one.
What can I do in order to display all the plots ?

This code isn’t working, it’s only to illustrate (and spot mistakes if there are some).

using Plots       # permet d'utiliser les commandes de 'Plots' dans le script

p1=plot(Te,Xe[:,1], label="Euler", title = "Solution de Van der Pol (composante 1)",reuse=false)
plot!(Tr,Xr[:,1], label="Runge")
plot!(Th,Xh[:,1], label="Heun")
plot!(Trk1,Xrk1[:,1], label="Rk41")
plot!(Trk2,Xrk2[:,1], label="Rk42")
plot!(Tg,Xg[:,1], label="Gauss")
xlabel!("t")
ylabel!("x_1(t)")

p2=plot(Te,Xe[:,2], label="Euler", title = "Solution de Van der Pol (composante 2)" , reuse=false)
plot!(Tr,Xr[:,2], label="Runge")
plot!(Th,Xh[:,2], label="Heun")
plot!(Trk1,Xrk1[:,2], label="Rk41")
plot!(Trk2,Xrk2[:,2], label="Rk42")
plot!(Tg,Xg[:,2], label="Gauss")
xlabel!("t")
ylabel!("x_2(t)")

p3=plot(Xe[:,1], Xe[:,2], label="Euler", title = "Plan de phase", reuse=false)
plot!(Xr[:,1], Xr[:,2], label="Runge")
plot!(Xh[:,1], Xh[:,2], label="Heun")
plot!(Xrk1[:,1], Xrk1[:,2], label="Rk41")
plot!(Xrk2[:,1], Xrk2[:,2],  label="Rk42")
plot!(Xg[:,1], Xg[:,2], label="Gauss")
xlabel!("x_1(t)")
ylabel!("x_2(t)")

display(p1) 
display(p2)
display(p3)       #Only this one is displayed

Thanks for your time

I have found a way.

display(p1)
readline(STDIN)
display(p2)
readline(STDIN)
display(p3)

I am using Win10 and Julia 1.6.1.

When I run the following code I also only obtain one plot.

However when I comment out the gr() and uncomment inspectdr() I get three plots.

I need to load gnuplots before I can try out gaston, I have not done that yet.

So this issue appears to be backend dependent.

using Plots
gr()
#inspectdr()
#gaston()

# Plot 1
x = 1:25
y = 1*rand(25,3)
p1 = plot(x, y, legend=false, title = "Plot 1", xlabel = "Abscissa", ylabel = "Ordinate")

# Plot 2
x = 1:25
y = 2*rand(25,3)
p2 = plot(x, y, legend=false, title = "Plot 2", xlabel = "Abscissa", ylabel = "Ordinate")

# Plot 3
x = 1:25
y = 3*rand(25,3)
p3 = plot(x, y, legend=false, title = "Plot 3", xlabel = "Abscissa", ylabel = "Ordinate")

display(p1)
display(p2)
display(p3)

1 Like