# How to make plots appear inside a pane in vscode (instead of "GKS QtTerm")?

**URL:** <https://discourse.julialang.org/t/how-to-make-plots-appear-inside-a-pane-in-vscode-instead-of-gks-qtterm/66930>\
**Category:** VS Code\
**Tags:** question, plotting, vscode\
**Created:** [August 24, 2021, 5:59pm UTC](https://discourse.julialang.org/t/how-to-make-plots-appear-inside-a-pane-in-vscode-instead-of-gks-qtterm/66930 "2021-08-24T17:59:00Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![mkarikom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkarikom/32/7096_2.png) [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Post date:** [August 24, 2021, 5:59pm UTC](https://discourse.julialang.org/t/how-to-make-plots-appear-inside-a-pane-in-vscode-instead-of-gks-qtterm/66930/1 "2021-08-24T17:59:00Z")

</div>

### Question:

How can I get a plots pane and not in “GKS QtTerm” (not sure what GKS or QtTerm are)?

### Background:

#### 1. On the julia vscode site, it shows the plot inside a pane:

 ![vscodesite](https://global.discourse-cdn.com/julialang/original/3X/6/5/65e8d44b37b206867a99a6658acb302f5ac21ae6.png)

#### However, when I try to plot, it always opens a separate window (intentional MATLAB throwback?):

 ![jlplot](https://global.discourse-cdn.com/julialang/original/3X/5/4/543ad3c9373babbb9aedd3f556f3cf237a2dfc5e.png)

---

<div class="post-metadata">

**Author:** ![Soldalma](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/soldalma/32/29388_2.png) [@Soldalma](https://discourse.julialang.org/u/Soldalma)\
**Post date:** [October 7, 2021, 4:43am UTC](https://discourse.julialang.org/t/how-to-make-plots-appear-inside-a-pane-in-vscode-instead-of-gks-qtterm/66930/2 "2021-10-07T04:43:47Z")

</div>

I have the same exact problem.

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [October 7, 2021, 5:24am UTC](https://discourse.julialang.org/t/how-to-make-plots-appear-inside-a-pane-in-vscode-instead-of-gks-qtterm/66930/3 "2021-10-07T05:24:42Z")

</div>

Please check in VS Code settings the “Display plots within vscode” option and restart Julia.

---

<div class="post-metadata">

**Author:** ![Soldalma](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/soldalma/32/29388_2.png) [@Soldalma](https://discourse.julialang.org/u/Soldalma)\
**Post date:** [October 7, 2021, 12:06pm UTC](https://discourse.julialang.org/t/how-to-make-plots-appear-inside-a-pane-in-vscode-instead-of-gks-qtterm/66930/4 "2021-10-07T12:06:09Z")

</div>

Thanks for calling this setting to my attention. I wasn’t aware of its existence. The text is:

Julia: Use Plots Pane  
Display Plots within VSCode. Might require a restart of the Julia process.

I tried it and it did not work. I even rebooted my PC to make sure I was in a new Julia session. The setting does not seem to have any effect on whether the chart appears in the Plots Pane. There must be something blocking VSCode from doing that.

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [October 7, 2021, 1:02pm UTC](https://discourse.julialang.org/t/how-to-make-plots-appear-inside-a-pane-in-vscode-instead-of-gks-qtterm/66930/5 "2021-10-07T13:02:27Z")

</div>

Please post a minimum (non) working example (MWE).

---

<div class="post-metadata">

**Author:** ![Soldalma](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/soldalma/32/29388_2.png) [@Soldalma](https://discourse.julialang.org/u/Soldalma)\
**Post date:** [October 7, 2021, 2:30pm UTC](https://discourse.julialang.org/t/how-to-make-plots-appear-inside-a-pane-in-vscode-instead-of-gks-qtterm/66930/6 "2021-10-07T14:30:25Z")

</div>

This is the best I could do, nine lines of code in two files.

The environment is `BootWalk`.

Main file, `TestPlots.jl`:

```julia
cd("C:/Dropbox/Code/Julia/bootstrapwalkforward/BootWalk/src")
include("./PlotsOnAnotherModule.jl")

```

Module file: `PlotsOnAnotherModule.jl`:

```julia
module PlotsOnAnotherModule

import Plots

function foo()
    p = Plots.plot!([1.0, 2, 3, 4, 6, 8, 10], show = true)
end

foo() # This is the call that creates the plot

end

```

Both files are in `C:/Dropbox/Code/Julia/bootstrapwalkforward/BootWalk/src`.

To reproduce the problem:

1. Close the existing REPL, if any, by clicking on the garbage can on the top right of its window.

2. Open a new REPL with `Alt+J Alt+O`.

3. Select file `TestPlots.jl`.

4. Hit `Ctrl+A` to select all the code. Alternatively go to the bottom of the file and hit `Ctrl+Shift+Home`.

5. Hit `Ctrl+Enter` to execute the selected code in the REPL. (It may be a different key combination in other systems).

What will happen:

After a while the `GKS QtTerm` window will pop up and will stay up even after the code is all executed. No plot will appear in the Julia Plots pane. If there were already plots on the Julia Plot pane the number of plots on the tab will not increase.

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [October 7, 2021, 2:46pm UTC](https://discourse.julialang.org/t/how-to-make-plots-appear-inside-a-pane-in-vscode-instead-of-gks-qtterm/66930/7 "2021-10-07T14:46:01Z")

</div>

Adjusting the VS Code plot settings as indicated above and then adding to TestPlots.jl:

```julia
PlotsOnAnotherModule.foo()

```

does get the plot displayed in the VS Code plot pane.

---

<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:** [October 7, 2021, 4:26pm UTC](https://discourse.julialang.org/t/how-to-make-plots-appear-inside-a-pane-in-vscode-instead-of-gks-qtterm/66930/8 "2021-10-07T16:26:15Z")

</div>

`show = true` seems weird. I’d recommend explicitly using `display` instead.

---

<div class="post-metadata">

**Author:** ![Soldalma](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/soldalma/32/29388_2.png) [@Soldalma](https://discourse.julialang.org/u/Soldalma)\
**Post date:** [October 7, 2021, 8:24pm UTC](https://discourse.julialang.org/t/how-to-make-plots-appear-inside-a-pane-in-vscode-instead-of-gks-qtterm/66930/9 "2021-10-07T20:24:56Z")

</div>

This will work. But that is not what I want to do. I want the plot to be generated from within a function that is within a module.

---

<div class="post-metadata">

**Author:** ![Soldalma](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/soldalma/32/29388_2.png) [@Soldalma](https://discourse.julialang.org/u/Soldalma)\
**Post date:** [October 7, 2021, 9:36pm UTC](https://discourse.julialang.org/t/how-to-make-plots-appear-inside-a-pane-in-vscode-instead-of-gks-qtterm/66930/10 "2021-10-07T21:36:16Z")

</div>

It worked. Terrific! Many thanks. Still only works from the REPL, not if I hit Ctrl+F5. But I guess that is the way it is supposed to be, at least for now.

---

<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:** [October 8, 2021, 9:51am UTC](https://discourse.julialang.org/t/how-to-make-plots-appear-inside-a-pane-in-vscode-instead-of-gks-qtterm/66930/11 "2021-10-08T09:51:56Z")

</div>

> [@Soldalma](#):
>
> Still only works from the REPL, not if I hit Ctrl+F5.

Yeah, that’s to be expected atm. The plot pane isn’t hooked up to the `Run in new process` functionality.

---

<div class="post-metadata">

**Author:** ![adannenberg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/adannenberg/32/7869_2.png) [@adannenberg](https://discourse.julialang.org/u/adannenberg)\
**Post date:** [September 14, 2022, 12:30pm UTC](https://discourse.julialang.org/t/how-to-make-plots-appear-inside-a-pane-in-vscode-instead-of-gks-qtterm/66930/12 "2022-09-14T12:30:30Z")

</div>

This problem is back.

Julia 1.8.1  
Linux (PopOS 22.04)  
Visual Studio Code 1.71.1

Anyone know how to fix it?

---

<div class="post-metadata">

**Author:** ![adannenberg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/adannenberg/32/7869_2.png) [@adannenberg](https://discourse.julialang.org/u/adannenberg)\
**Post date:** [September 14, 2022, 12:45pm UTC](https://discourse.julialang.org/t/how-to-make-plots-appear-inside-a-pane-in-vscode-instead-of-gks-qtterm/66930/13 "2022-09-14T12:45:27Z")

</div>

Problem has resolved with a restart. No idea why…

---

<div class="post-metadata">

**Author:** ![Minh\_Tu\_n\_Ha](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/minh_tu_n_ha/32/53066_2.png) [@Minh\_Tu\_n\_Ha](https://discourse.julialang.org/u/Minh_Tu_n_Ha)\
**Post date:** [September 23, 2023, 2:00am UTC](https://discourse.julialang.org/t/how-to-make-plots-appear-inside-a-pane-in-vscode-instead-of-gks-qtterm/66930/15 "2023-09-23T02:00:49Z")

</div>

Yes. I have a same problem
