How to know which plotting backend is in use?


#1

I know how to switch between backends following the Plots tutorial. Is there a way to check which backend is in use? Didn’t search the tutorial carefully. Thanks in advance for a pointer if I’ve missed it …


#2

Just realized backend() does the job.


#3

Each time I restart Julia or reload Plots, the default backend is always set back to GR, which is never my first choice. Is there a way that I can set another backend, e.g. PyPlot, as default without removing GR? Thanks!


#4

put something like

ENV["PLOTS_DEFAULT_BACKEND"] = my_favorite_backend

in your ~/.juliarc.jl.


#5

Thanks! I tried what you suggested and when restarted Julia, the following error was thrown:

chobbes@chobbes-XPS-15-9550:~/juliapro/JuliaPro-0.6.0.1$ ./julia
ERROR: LoadError: UndefVarError: pyplot not defined
Stacktrace:
 [1] include_from_node1(::String) at ./loading.jl:569
 [2] include(::String) at ./sysimg.jl:14
 [3] try_include at ./client.jl:244 [inlined]
 [4] load_juliarc() at ./client.jl:321
 [5] process_options(::Base.JLOptions) at ./client.jl:275
 [6] _start() at ./client.jl:371
while loading /home/chobbes/.juliarc.jl, in expression starting on line 12

I must have missed something. Btw, I tried all possible capitalization or camel cases. Any clud?


#6

Did you use a string on the right-hand side?


#7

Thanks for reminding. I totally forgot quotes.