Using PowerShell, I ssh’d to my Ubuntu20.04 workstation from my Windows laptop with X11forwarding support on. xeyes runs and displays just fine. However, running the following in the REPL initially produced the same error as ‘affans’.
using Plots
x = 1:10; y = rand(10); # These are the plotting data
plot(x, y
The suggestion from ‘zekeriya.sari’ took the error away but did not make the plotting work. Running the above code compiles and runs just fine but no plot is displayed.
Putting the code snippet in tests/myTest.jl and running,
julia --project=. tests/myTest.jl
also compliles and runs without error but no plot is displayed.
Interestingly, if I run VS Code on my laptop, with Remote Development, Remote - SSH, and Julia extensions enabled, I do successfully get a plot but only if I use the Julia Extension REPL (meaning, I launch the REPL using alt-j, alt-o). The plot is displayed as another tab in the VS Code workspace environment.
Further testing showed that if I run the REPL manually from the integrated terminal (e.g. running,
julia project=.
the above code snippet compiles and runs without problem but does NOT display the plot. Likewise, runing
julia --project=. tests/myTest.jl
from the VS Code integrated terminal successfully compiles and runs but no plot is displayed.
So, only 1 of these 4 scenarios successfully plotted, using the Julia VS Code extension REPL.
This is find but I am curious how to make this work without the REPL as I am doing most development right now without the REPL (embedding Julia code in an existing C++ program).
Thoughts?