JBar
JBar

Reputation: 145

Display multiple plots with Plots.jl

I currently have two vectors, x and y which I plot separately as in

using Plots
pyplot() # chooses pyplot background
x = rand(100); y = rand(100)
plt1 = plot(x)
display(plt1)
plt2 = plot(y)
display(plt2)

I have also tried the gui() and gui(plt1) functions, but these have a similar effect as the display(plt1) function. Also note that I am running this in a file (hence the necessity of the display() function). I have also tried similar code in the REPL, which has the same problem of only displaying the last plot I call.

My question is how do I display two different figures at the same time? My current implementation has plt2 overwrite plt1, so I am not able to see them at the same time. Note that I am not looking for making a subplot, but rather two distinct figures. Is there a figure() function similar to Matplotlib which allows declaration of separate figures?

Upvotes: 5

Views: 7982

Answers (1)

Michael K. Borregaard
Michael K. Borregaard

Reputation: 8044

Yes, use the phrase plt2 = plot(y, reuse = false)

Upvotes: 5

Related Questions