Issue with plots in vscode

in a command window the following produces a plot (2 messages).
Run in vscode doesnt produc a plot.

julia> using Plots

(process:23960): GLib-GIO-WARNING **: 09:56:57.906: Unexpectedly, UWP app Microsoft.Office.OneNote_16001.12026.20112.0_x64__8wekyb3d8bbwe' (AUMId Microsoft.Office.OneNote_8wekyb3d8bbwe!microsoft.onenoteim’) supports 2 extensions but has no verbs

(process:23960): GLib-GIO-WARNING **: 09:56:57.928: Unexpectedly, UWP app Microsoft.MicrosoftSolitaireCollection_4.4.8204.0_x64__8wekyb3d8bbwe' (AUMId Microsoft.MicrosoftSolitaireCollection_8wekyb3d8bbwe!App’) supports 1 extensions but has no verbs

julia> #versioninfo()

julia> x = 1:10; y = rand(10); # These are the plotting data

julia> plot(x, y)

julia> versioninfo()
Julia Version 1.6.1
Commit 6aaedecc44 (2021-04-23 05:59 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: Intel(R) Core™ i7-8650U CPU @ 1.90GHz
LIBM: libopenlibm
LLVM: libLLVM-11.0.1 (ORCJIT, skylake)



This came up before and I don’t think anything on our side is at fault here. You could try reinstalling those apps.

1 Like

Your problem seems to be the: x
Usual in Julia you don’t need the x-coordinate
You can write:

using Plots

Or if you want/need the x-coordinate(like in Python)

using Plots

or complete Julia-like

plot(collect(1:10), rand(10))


No, there’s no problem with the x coordinates here. Just using a range 1:10 works just fine, and is recommended over collect(1:10) as collect unnecessarily allocates an array here.

You are right of course that 1:10 are the default x values for plotting a vector of length 10 anyways so it can be left out.