juliamakie.jlagents.jl

Figure instead of InteractiveDynamics app for julia agents model


I am following the schelling.jl tutorial from the Agents.jl package (https://juliadynamics.github.io/Agents.jl/stable/examples/schelling/). Towards the end of the tutorial they create an interactive application. But when I run the script (include("schelling.jl")), I end up with figure instead of an interactive app (cannot click on the run, reset buttons since it appears to be a figure). Any ideas how I get it as an interactive app?

using InteractiveDynamics
figure, adf, mdf = abm_data_exploration(model, agent_step!, dummystep, parange; ac=groupcolor, am=groupmarker, as = 10, adata, alabels)

Note I am using vscode IDE

enter image description here


Solution

  • You need to specify the proper plotting backend, CairoMakie can output static vector graphics but it can't open interactive windows. You can use GLMakie or WGLMakie instead.

    Package Description
    GLMakie.jl GPU-powered, interactive 2D and 3D plotting in standalone GLFW.jl windows.
    CairoMakie.jl Cairo.jl based, non-interactive 2D backend for publication-quality vector graphics.
    WGLMakie.jl WebGL-based interactive 2D and 3D plotting that runs within browsers.
    RPRMakie.jl An experimental ray tracing backend.

    @see Mackie's Backends & Output