VSCode plots wont show anymore anywhere

I have had no issues with VSCode plots until all of a sudden, they stopped showing up. I dont even know what I changed because no matter what I do, the plots dont show up whatsoever.

I’m using PlotlyJS, and a simple line in the REPL would usually show up in a plot pane inside VSCode. However now when I try make a simple plot like below, nothing shows except for some text inside the Plot Navigator. The pane seems to have disappeared and I cant find how to get it back.

using PlotlyJS
p = make_subplots()
p

image

And yes, I have ticked “display plots inside VSCode” in the settings. I’ve also restarted VS Code several times.

Any ideas?

Have you restarted vscode? Have you updated packages? Was there a downgrade? Are you on Julia 7?

As a quick way out, you can install vscodium and see if you get lucky (it’s Visual Studio Code minus the data sharing features that Microsoft leverages from the product).

I’ve definitely restarted and updated julia and all the packages to the latest version. It had been working fine for ages until very recently too so really would like to get to the bottom of this :\

Thanks for the vscodium link, but unfortunately does not work… like VSCode, the only response is it shows under plot Navigation, so I know something is happening, but still no plot nor pane…

I’ve also noticed that under the Julia tab in the workspace region, there’s nothing under p > “window”.
image

Maybe related: VS code plot pane won't stay splitted - #9 by lmiq

(I had to downgrade VSCode)

1 Like

I have the same problem with VegaLite. However, I can plot using Plots.

It’s definitely annoying the hell out of me, I’ve even tried reinstalling VSCode and deleting the cache inside %Appdata%\Code…

Since a re-install still didnt seem to work, I’m at my wit’s end.
The only good news is I found I could still have plots show externally if I disable the “Use Plot Pane” setting, but it simply quite isnt the same…

image

I reinstalled VSCode to version 1.56.2. VegaLite seems to work fine now.

1 Like

Same experience here. I was also forced to downgrade, which is unfortunate, since that also downgrades the Julia extension, and some nice recent features are lost.

I have had the same problem after the last VSCode update. In my case I could find a workaround. First, I have enabled Editor setting: Workbench > Editor: Reveal if Open → Enabled. See also https://stackoverflow.com/questions/70293097/vscode-open-the-julia-plots-editor-in-a-fixed-location/70299224

Then each coding session I start with three lines (can be done sequentially in REPL):
using Plots
gr()
plot(1,1)

After that my code works and the plots appear in the plot pane on the right like before. Though, the beginning of my code is:
using Plots
plotly()

It also works for plotlyjs().

Note, if your plot pane is gone completely, then “Split Editor Right” and drag-and-drop there your first graph made with gr() backend.

1 Like

I have the same problem. I did not update VSCode.

gr()
plot(1,1)

works but only that. My code still does not plot anything.

You should consider updating VS Code and the Julia extension to the latest version.

Now it works again. I updated, I am not sure if that was the reason.

I am new to Julia and am also facing this problem. The plots show fine when running via terminal (REPL) but don’t work via VS Code.

Version: Julia 1.8.1
VS Code: 1.71.2

I have tried enabling and disabling Julia: Use plot plane setting in VS code. No impact.

1 Like

I even tried Julia: Execute active File in REPL but the plot doesn’t show.

However if I copy-paste the code in REPL the plot shows.

Am I missing some setting in VS code?

You need to actively display your plots when running files.

@pfitzseb Thank you.

Adding display(p) solved the issue.

1 Like

I am also having this issue using notebooks in vscode.

I tried all tricks mentioned here, and nothing makes the plots appear inline nor in a separate panel.