5

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?

JBar
  • 145
  • 3
  • 6

1 Answers1

4

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

Michael K. Borregaard
  • 7,864
  • 1
  • 28
  • 35
  • I am creating scatter plots using (scatter) on version .4.5, and I only get the second of the two scatter plots, as well; each time I run the scatter using the above modification, the figure number is incremented – Vass Oct 08 '17 at 18:47
  • 1
    You can use legacy versions of Plots on Julia versions <0.6, but they are unsupported and may have bugs. I'd strongly suggest you update julia to the current version. – Michael K. Borregaard Oct 08 '17 at 19:00