How do I make a Makie animation appear in a VSCode plotting window?

One cannot animate with GLMakie inside VSCode’s plotting pane, currently. There’s this PR which might give the ability to do that at some point by updating a specific image over time: WIP: display_with_id by pfitzseb · Pull Request #2940 · julia-vscode/julia-vscode · GitHub

To make a live animation, you can either use GLMakie and open a native window, updating your plots via observables in a for loop or so, as was noted above. Or you can use WGLMakie, which can use web contexts to display a javascript-controlled plot, which can also be updated via observables, and the VSCode plot pane happens to be such a web context. But note that WGLMakie is both slower, as well as not as feature complete as GLMakie. For example, currently it still doesn’t have picking which means things that require information about what stuff was clicked on don’t work (but this is being worked on).

1 Like