I found the following example in julialang regarding switching between backends:
#Pkg.add("Plots")
using Plots
plotly() # Choose the Plotly.jl backend for web interactivity
plot(rand(5,5),linewidth=2,title="My Plot")
#Pkg.add("PyPlot") # Install a different backend
pyplot() # Switch to using the PyPlot.jl backend
plot(rand(5,5),linewidth=2,title="My Plot2") # The same plotting command works```
But I have 2 problems when I run this code:
-
I only see the second plot, and not the first one when I run the entire code. How can I see both plots at the same time?
-
I’d like to have
using PyPlot ion()
in my juliarc to get the figures in another window. But when I have this I get the following error message:
WARNING: both Plots and PyPlot export "plot"; uses of it in module Main must be qualified
UndefVarError: plot not defined
can I solve this somehow so I can still include that in my juliarc.jl?