How to switch between plotting packages and backends, or use two simultaneously?


#1

If I’m using Plots.jl I can choose the GR backend by typing gr().
If I’m using Makie how can I change the backend from GL to GR or vice versa?

And if I’m using Plots.jl and I load Makie.jl then all new plots will be generated by Makie. How can I switch back to Plots.jl or vice versa?
I’ve tried by runningusing Plots again but it doesn’t seem to make any difference.
How can I know what package and backend are been used by graphic commands (such as scatter(…))?

And more difficult… How can I simultaneously have two windows opened, one with Makie+GL plots and the other one with Plots+GR?

I’m using VS Code and would like to compare different plotting packages. Any solution with Juno or Jupyter is also welcome.


#2

Re your second paragraph:

using Plots
a = rand(100)
plot(a) # Plot{Plots.GRBackend() n=1}

using PyPlot
plot(a) # Plot{Plots.GRBackend() n=1}
PyPlot.plot(a) # PyCall.PyObject[1]
@which plot(a) # plot() method from Plots.jl
@which PyPlot.plot(a) # plot() method from PyPlot

#3

Note that there is also import (instead of using) which won’t clutter your global namespace.