# How to know which plotting backend is in use?

**URL:** https://discourse.julialang.org/t/how-to-know-which-plotting-backend-is-in-use/5987
**Category:** Visualization
**Created:** [September 19, 2017, 10:30pm UTC](https://discourse.julialang.org/t/how-to-know-which-plotting-backend-is-in-use/5987 "2017-09-19T22:30:18Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![chobbes](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@chobbes](https://discourse.julialang.org/u/chobbes)
#### Post date: [September 19, 2017, 10:30pm UTC](https://discourse.julialang.org/t/how-to-know-which-plotting-backend-is-in-use/5987/1 "2017-09-19T22:30:18Z")

</div>

I know how to switch between backends following [the Plots tutorial](https://juliaplots.github.io/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 …

---

<div class="post-metadata">

### Author: ![chobbes](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@chobbes](https://discourse.julialang.org/u/chobbes)
#### Post date: [September 19, 2017, 11:15pm UTC](https://discourse.julialang.org/t/how-to-know-which-plotting-backend-is-in-use/5987/2 "2017-09-19T23:15:55Z")

</div>

Just realized `backend()` does the job.

---

<div class="post-metadata">

### Author: ![chobbes](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@chobbes](https://discourse.julialang.org/u/chobbes)
#### Post date: [September 20, 2017, 11:15am UTC](https://discourse.julialang.org/t/how-to-know-which-plotting-backend-is-in-use/5987/3 "2017-09-20T11:15:37Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [September 20, 2017, 11:57am UTC](https://discourse.julialang.org/t/how-to-know-which-plotting-backend-is-in-use/5987/4 "2017-09-20T11:57:26Z")

</div>

put something like

```julia
ENV["PLOTS_DEFAULT_BACKEND"] = my_favorite_backend

```

in your `~/.juliarc.jl`.

---

<div class="post-metadata">

### Author: ![chobbes](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@chobbes](https://discourse.julialang.org/u/chobbes)
#### Post date: [September 20, 2017, 12:09pm UTC](https://discourse.julialang.org/t/how-to-know-which-plotting-backend-is-in-use/5987/5 "2017-09-20T12:09:41Z")

</div>

> [@Tamas\_Papp](#):
>
> put something like
> 
> ENV[“PLOTS\_DEFAULT\_BACKEND”] = my\_favorite\_backend
> 
> in your ~/.juliarc.jl.

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

```julia
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?

---

<div class="post-metadata">

### Author: ![smldis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/smldis/32/1735_2.png) [@smldis](https://discourse.julialang.org/u/smldis)
#### Post date: [September 20, 2017, 12:28pm UTC](https://discourse.julialang.org/t/how-to-know-which-plotting-backend-is-in-use/5987/6 "2017-09-20T12:28:31Z")

</div>

> [@chobbes](#):
>
> PLOTS\_DEFAULT\_BACKEND

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

---

<div class="post-metadata">

### Author: ![chobbes](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@chobbes](https://discourse.julialang.org/u/chobbes)
#### Post date: [September 20, 2017, 12:35pm UTC](https://discourse.julialang.org/t/how-to-know-which-plotting-backend-is-in-use/5987/7 "2017-09-20T12:35:33Z")

</div>

Thanks for reminding. I totally forgot quotes.
