Windows based CLI/VSCode Term. is not displaying data visualizations (C/P into REPL works. though)(GLMakie)

Hi,

So I seem to have some wires crossed in my system somewhere and I am reaching out to see if anyone has experienced any similiar issues.

I have been working with GLMakie a bit, playing around with data visualization and at one point I was able to compile and visualize the demos from GLMakie (Beautiful Makie)

At this point, if I run the script from the command line, (julia script.jl) OR if I am running it in the Visual Studio terminal, it is clearly compiling, but then returns to terminal prompt without displaying the windows with the visualization. However, if I copy and paste the script directly into the REPL it will load the windows with the visualization.

If anyone has any ideas about where to look around to straighten this out I would appreciate feedback.

Thanks.

If it’s in a script, I think you need to use the function display. This is the same when using Plots. E.g.

plt = create_figure()
display(plt)

This should work, but I don’t know whether the windows will close as soon as the script finishes running. I would recommend using the “built-in” VS code REPL and using the “play” button to run the whole script in the open REPL if you have any issues.

1 Like

I think I’ve seen wait(display(plt)) before to avoid that the process finishes afterwards if you’re not in a REPL. And there is also the -i flag for julia to start the REPL after the script has finished. Here’s an example with the -e flag which would usually also quit directly after: julia -i -e 'display(1 + 1)'

Starting a GLMakie project from julia some_script.jl will currently incur a lot of compilation latency each time, which will not be much fun. So I recommend starting a repl and then doing include("some_script.jl") as an alternative. Or even Revise.jl based workflows where you do includet("some_source.jl") and then edit/save and run_some_function().

2 Likes

This helped with my issue. Thanks jmair, jules

1 Like