# GLMakie in VSCode single plot popout

**URL:** <https://discourse.julialang.org/t/glmakie-in-vscode-single-plot-popout/68132>\
**Category:** VS Code\
**Tags:** makie, glmakie\
**Created:** [September 14, 2021, 7:43am UTC](https://discourse.julialang.org/t/glmakie-in-vscode-single-plot-popout/68132 "2021-09-14T07:43:52Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheLateKronos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thelatekronos/32/12824_2.png) [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Post date:** [September 14, 2021, 7:43am UTC](https://discourse.julialang.org/t/glmakie-in-vscode-single-plot-popout/68132/1 "2021-09-14T07:43:52Z")

</div>

I like the plot pane in VSCode, and I wish to use it by default. I also love how GLMakie plots scale up and down in size as I ajust the width of the plotting pane.

But sometimes I want to interact with the plot, for data-inspection, panning or zooming. I used to be able to call `current_figure()` in the buildt-in terminal, and I would get a standalone window that is interactable. Now, it just creates a new plot in the plotting pane.

I know that I can change the backend to `WGLMakie` to get interactivity in the build-in plotting pane, but

1. It seems less responsive and stable,
2. When interacting with a plot, it is nice to have the standalone window fill the screen, and
3. I prefer not having to juggle two backends.

So is there a way to get a single plot in the standalone window, while still using the buildt-in plot pane by default?

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [September 14, 2021, 8:27am UTC](https://discourse.julialang.org/t/glmakie-in-vscode-single-plot-popout/68132/2 "2021-09-14T08:27:05Z")

</div>

If you call Makie.inline!(true) you get the plot pane, and for false you get the window in GLMakie

---

<div class="post-metadata">

**Author:** ![TheLateKronos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thelatekronos/32/12824_2.png) [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Post date:** [September 14, 2021, 8:43am UTC](https://discourse.julialang.org/t/glmakie-in-vscode-single-plot-popout/68132/3 "2021-09-14T08:43:47Z")

</div>

Not really, unfortunatly.

When I call

```julia
Makie.inline!(false)
current_figure()

```

from the script, I get a new plot in the plot-pane. So I can not see any difference between calling `Makie.inline!(false)` and `Makie.inline!(true)`, before calling `current_figure()` from the script.

When I call

```julia
julia> Makie.inline!(false)

julia> current_figure()

```

in the build in terminal, there is a difference - _nothing happens_. When I call

```julia
julia> Makie.inline!(true)

julia> current_figure()

```

again, I again get new plots in the plot-pane.

So I appriciate the reply, and it sounds like the right approach, but it was unfortunatly not helpful in my case.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [September 14, 2021, 8:48am UTC](https://discourse.julialang.org/t/glmakie-in-vscode-single-plot-popout/68132/4 "2021-09-14T08:48:48Z")

</div>

Maybe @sdanisch can explain it better, the display system is a complicated thing.

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [September 14, 2021, 8:49am UTC](https://discourse.julialang.org/t/glmakie-in-vscode-single-plot-popout/68132/5 "2021-09-14T08:49:54Z")

</div>

You can temporarily disable the plot pane, e.g. at

 ![image](https://global.discourse-cdn.com/julialang/original/3X/d/f/df8e82a428481eadf3a2decfebcf7aabbc7ad670.png)

The other option would be to call e.g. `display(MakieDisplay(), p)` (for some value of `MakieDisplay`), which should force the display system to circumvent the VSCode display.

---

<div class="post-metadata">

**Author:** ![TheLateKronos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thelatekronos/32/12824_2.png) [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Post date:** [September 14, 2021, 9:04am UTC](https://discourse.julialang.org/t/glmakie-in-vscode-single-plot-popout/68132/6 "2021-09-14T09:04:41Z")

</div>

The `Disable plot pane` option was not available from that drop down for me, but I found it via the `Ctrl+shift+p` thingy (command palette?)

But when I do that, I get nothing happening from the script, and the following from the terminal:

```julia
julia> current_figure()
Scene (800px, 600px):
  18 Plots:
    ├ Combined{Makie.poly, Tuple{Vector{Vector{Point{2, Float32}}}}}
    ├ LineSegments{Tuple{Vector{Point{2, Float32}}}}
    ├ LineSegments{Tuple{Vector{Point{2, Float32}}}}
    ├ LineSegments{Tuple{Vector{Point{2, Float32}}}}
    ├ LineSegments{Tuple{Vector{Point{2, Float32}}}}
    ├ LineSegments{Tuple{Vector{Point{2, Float32}}}}
    ├ LineSegments{Tuple{Vector{Point{2, Float32}}}}
    ├ MakieCore.Text{Tuple{String}}
    ├ Lines{Tuple{Vector{Point{2, Float32}}}}
    ├ MakieCore.Text{Tuple{Vector{Tuple{AbstractString, Point{2, Float32}}}}}
    ├ LineSegments{Tuple{Vector{Point{2, Float32}}}}
    ├ LineSegments{Tuple{Vector{Point{2, Float32}}}}
    ├ MakieCore.Text{Tuple{String}}
    ├ Lines{Tuple{Vector{Point{2, Float32}}}}
    ├ MakieCore.Text{Tuple{Vector{Tuple{AbstractString, Point{2, Float32}}}}}
    ├ Lines{Tuple{Vector{Point{2, Float32}}}}
    ├ Lines{Tuple{Vector{Point{2, Float32}}}}
    └ MakieCore.Text{Tuple{String}}
  1 Child Scene:
    └ Scene (734px, 541px)  

```

So it seems like the fallback IO channel does not work as desired. So I would have to call `display` with the correct display channel. But I have no idea how to list available IO channels, and a quick google-search got me no further.

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [September 14, 2021, 9:24am UTC](https://discourse.julialang.org/t/glmakie-in-vscode-single-plot-popout/68132/7 "2021-09-14T09:24:29Z")

</div>

Hm, so Makie’s use of the display system is kinda wonky imo.

Anyways, you can switch between the plot pane with `GLMakie.inline!(false)` to enable it and `GLMakie.inline!(true)` to disable it.

---

<div class="post-metadata">

**Author:** ![TheLateKronos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thelatekronos/32/12824_2.png) [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Post date:** [September 14, 2021, 9:46am UTC](https://discourse.julialang.org/t/glmakie-in-vscode-single-plot-popout/68132/8 "2021-09-14T09:46:15Z")

</div>

So I restarted VSCode for unrelated reasons, and now I get the standalone window when sending the plotting-command to the terminal. This is the behaviour described in the original post. Weird…

So then I am back to evaluating lines of a script to send the plot to the plot pane, and sending it to the terminal for interaction.

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [September 14, 2021, 9:47am UTC](https://discourse.julialang.org/t/glmakie-in-vscode-single-plot-popout/68132/9 "2021-09-14T09:47:26Z")

</div>

That sounds buggy. There shouldn’t be any difference between the REPL and inline evaluation.

---

<div class="post-metadata">

**Author:** ![TheLateKronos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thelatekronos/32/12824_2.png) [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Post date:** [September 14, 2021, 9:52am UTC](https://discourse.julialang.org/t/glmakie-in-vscode-single-plot-popout/68132/10 "2021-09-14T09:52:48Z")

</div>

It indeed feels like a buggy hacky way to do things. But it works great for me.

Reminds me of a meme about some changelog saying a bug was fixed where the CPU would overheat with a certain command, and someone commenting that that was how they liked heating their room without getting up, and asking for a way to keep the old behaviour xD

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [September 14, 2021, 9:55am UTC](https://discourse.julialang.org/t/glmakie-in-vscode-single-plot-popout/68132/11 "2021-09-14T09:55:07Z")

</div>

[Yeah, as soon as I figure out why this happens you’ll need to find another way to heat your room](https://xkcd.com/1172/).

---

<div class="post-metadata">

**Author:** ![TheLateKronos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thelatekronos/32/12824_2.png) [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Post date:** [September 14, 2021, 10:04am UTC](https://discourse.julialang.org/t/glmakie-in-vscode-single-plot-popout/68132/12 "2021-09-14T10:04:20Z")

</div>

There it is! Yes, that is the meme xD

Here is a GIF showing the current behaviour, which I like  
 ![EUdo3TD9KS](https://global.discourse-cdn.com/julialang/original/3X/2/8/282480551fc11e9216bd0c54babe51d1995adf92.gif)
