I’m using:
vscode 1.59.1
Julia Language Support 1.3.33
Julia 1.6.1
Windows 10
GLMakie 0.4.6 (among many others)
I have code that retrieves data out of a SQLite db and displays in a simple series plot. When I either step through the file executing each line using ctrl+enter or selecting the whole file and using Alt+Enter, the plot shows just fine.
Here is a bit of the code…
fig = Figure(resolution=(1200,1800))
sc = display(fig)
Notifications_ax = Axis(fig[1,1])
series!(Notifications_ax,InfectionCount’)
Notifications_ax.yticks = 0:1:20
Notifications_ax.title =string("Covid Cases for “,lga,” between “,startdate,” and ", enddate)
Notifications_ax.xlabel = “Days”
Notifications_ax.ylabel = “Number of cases”
However when I try and run the file using wither F5 or ctrl+F5 a white Makie window appears, stays blank for a minute then closes without ever showing the plot. This behavior is repeatable, even after restarting vscode.
Can anyone point me in a direction that might get me to the bottom of this? Could this be related to bad code or perhaps incompatibilities between packages?
If you run a file in VSCode, I think a new julia process is opened and the code run until it’s done and the julia process exits. When your code is done, the Makie window will just close again because there’s nothing keeping the process running and the window open. I guess there should be some kind of option to run a file such that afterwards it goes into interactive Repl mode. Or you include your code file from the repl instead of using the run file option from vscode.
Thanks jules, seb. Both worked and I’m starting to understand the execution paradigm, Should there be any performance difference between these two methods?
You can also use one of the “execute code cell” commands.
If you didn’t mark any cells boundaries (a line starting with ##), the whole file is one cell, so it’s executed in the REPL.