I want to visualize multiple figures in Julia to compare them, and I want to open two separate figures.
Let's say I want to compare two sets of random numbers in two separate windows. In MATLAB, this can be easily done with
figure(1)
scatter(1:10, rand(10,1))
figure(2)
scatter(1:10, rand(10,1))
This answer describes how to place the plots next to each other in Julia. For example, the following code does that.
using Plots
p1 = plot(LinRange(1,10,10),rand(10))
p2 = plot(LinRange(1,10,10),rand(10))
plot(p1,p2)
Is there any way to open the plots simultaneously in two different windows in Julia, like MATLAB?
If the Plots
package cannot do that, is there another package that implements this feature?
A workaround can be using the PythonPlot
backend. It's a drop in replacement for pyplot
. First, install this backend using ] add PythonPlot
. Then continue:
julia> using Plots
julia> pythonplot()
Plots.PythonPlotBackend()
julia> p1 = plot(LinRange(1,10,10),rand(10))
julia> p2 = plot(LinRange(1,10,10),rand(10), reuse=false)