How can I get a plots pane and not in “GKS QtTerm” (not sure what GKS or QtTerm are)?
I have the same exact problem.
Please check in VS Code settings the “Display plots within vscode” option and restart Julia.
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.
Please post a minimum (non) working example (MWE).
This is the best I could do, nine lines of code in two files.
The environment is
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
To reproduce the problem:
Close the existing REPL, if any, by clicking on the garbage can on the top right of its window.
Open a new REPL with
Ctrl+Ato select all the code. Alternatively go to the bottom of the file and hit
Ctrl+Enterto 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.
Adjusting the VS Code plot settings as indicated above and then adding to TestPlots.jl:
does get the plot displayed in the VS Code plot pane.
show = true seems weird. I’d recommend explicitly using
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.
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.
Yeah, that’s to be expected atm. The plot pane isn’t hooked up to the
Run in new process functionality.