# Is there a way to switch between inline and interactive mode with IJulia and PyPlot?

**URL:** <https://discourse.julialang.org/t/is-there-a-way-to-switch-between-inline-and-interactive-mode-with-ijulia-and-pyplot/21128>\
**Category:** General Usage\
**Created:** [February 24, 2019, 1:04am UTC](https://discourse.julialang.org/t/is-there-a-way-to-switch-between-inline-and-interactive-mode-with-ijulia-and-pyplot/21128 "2019-02-24T01:04:13Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![marius311](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marius311/32/3953_2.png) [@marius311](https://discourse.julialang.org/u/marius311)\
**Post date:** [February 24, 2019, 1:04am UTC](https://discourse.julialang.org/t/is-there-a-way-to-switch-between-inline-and-interactive-mode-with-ijulia-and-pyplot/21128/1 "2019-02-24T01:04:14Z")

</div>

Basically I’m working in Jupyter notebook and occasionally I want to pop out a plot into its own window to make it interactive (otherwise inline by default is OK). Is this possible?

---

<div class="post-metadata">

**Author:** ![c42f](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/c42f/32/52842_2.png) [@c42f](https://discourse.julialang.org/u/c42f)\
**Post date:** [February 24, 2019, 4:07am UTC](https://discourse.julialang.org/t/is-there-a-way-to-switch-between-inline-and-interactive-mode-with-ijulia-and-pyplot/21128/2 "2019-02-24T04:07:56Z")

</div>

You can toggle this behaviour inside jupyter before plotting:

```julia
PyPlot.pygui(true)

```

You’ve also got to have the current jupyter kernel running on your local machine for this to work.

---

<div class="post-metadata">

**Author:** ![marius311](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marius311/32/3953_2.png) [@marius311](https://discourse.julialang.org/u/marius311)\
**Post date:** [February 24, 2019, 4:19am UTC](https://discourse.julialang.org/t/is-there-a-way-to-switch-between-inline-and-interactive-mode-with-ijulia-and-pyplot/21128/3 "2019-02-24T04:19:04Z")

</div>

Ah nice, thanks!

---

<div class="post-metadata">

**Author:** ![davide](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davide/32/52136_2.png) [@davide](https://discourse.julialang.org/u/davide)\
**Post date:** [November 5, 2019, 10:21am UTC](https://discourse.julialang.org/t/is-there-a-way-to-switch-between-inline-and-interactive-mode-with-ijulia-and-pyplot/21128/4 "2019-11-05T10:21:59Z")

</div>

Is there something similar for when using Plots + pyplot() ?

---

<div class="post-metadata">

**Author:** ![c42f](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/c42f/32/52842_2.png) [@c42f](https://discourse.julialang.org/u/c42f)\
**Post date:** [November 5, 2019, 8:25pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-switch-between-inline-and-interactive-mode-with-ijulia-and-pyplot/21128/5 "2019-11-05T20:25:58Z")

</div>

It may also work to just use `PyPlot.pygui()` if you’re using the pyplot backend?

---

<div class="post-metadata">

**Author:** ![davide](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davide/32/52136_2.png) [@davide](https://discourse.julialang.org/u/davide)\
**Post date:** [November 5, 2019, 9:30pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-switch-between-inline-and-interactive-mode-with-ijulia-and-pyplot/21128/6 "2019-11-05T21:30:20Z")

</div>

Thanks @c42f, but I already tried it and I get the following message:

```julia
PyPlot.pygui(true)

ArgumentError: invalid gui none

Stacktrace:
 [1] pygui(::Symbol) at /home/davide/.julia/packages/PyCall/ttONZ/src/gui.jl:59
 [2] pygui_start(::Symbol, ::Float64) at /home/davide/.julia/packages/PyCall/ttONZ/src/gui.jl:222 (repeats 2 times)
 [3] pygui(::Bool) at /home/davide/.julia/packages/PyPlot/4wzW1/src/init.jl:224
 [4] top-level scope at In[11]:1

```

---

<div class="post-metadata">

**Author:** ![c42f](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/c42f/32/52842_2.png) [@c42f](https://discourse.julialang.org/u/c42f)\
**Post date:** [November 5, 2019, 10:16pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-switch-between-inline-and-interactive-mode-with-ijulia-and-pyplot/21128/7 "2019-11-05T22:16:50Z")

</div>

Looks like we’ve tried the obvious things then (I also tried calling `pygui` before loading `Plots`). It may be a source-reading exercise to figure out if there’s a way to do this.

The two libraries do trigger the actual plotting quite differently; `Plots` is more functional in nature (plots being show by `display`ing the value of the cell) and PyPlot quite imperative.

---

<div class="post-metadata">

**Author:** ![photor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/photor/32/14343_2.png) [@photor](https://discourse.julialang.org/u/photor)\
**Post date:** [April 26, 2020, 12:24am UTC](https://discourse.julialang.org/t/is-there-a-way-to-switch-between-inline-and-interactive-mode-with-ijulia-and-pyplot/21128/8 "2020-04-26T00:24:08Z")

</div>

I am experiencing the same problem. Have you solved it?

---

<div class="post-metadata">

**Author:** ![davide](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davide/32/52136_2.png) [@davide](https://discourse.julialang.org/u/davide)\
**Post date:** [April 26, 2020, 2:29pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-switch-between-inline-and-interactive-mode-with-ijulia-and-pyplot/21128/9 "2020-04-26T14:29:53Z")

</div>

No, but never tried any more.

---

<div class="post-metadata">

**Author:** ![Bienvenue\_Feugang\_Nt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bienvenue_feugang_nt/32/45386_2.png) [@Bienvenue\_Feugang\_Nt](https://discourse.julialang.org/u/Bienvenue_Feugang_Nt)\
**Post date:** [May 17, 2023, 7:41pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-switch-between-inline-and-interactive-mode-with-ijulia-and-pyplot/21128/10 "2023-05-17T19:41:19Z")

</div>

I was looking for something like this. Thanks it helps me a lot.
