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

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

The environment is BootWalk.

Main file, TestPlots.jl:

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

Module file: PlotsOnAnotherModule.jl:

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.