# Interactive ABM plot with agents and GLMakie

**URL:** https://discourse.julialang.org/t/interactive-abm-plot-with-agents-and-glmakie/98913
**Category:** Visualization
**Tags:** agents, glmakie
**Created:** [May 16, 2023, 7:59am UTC](https://discourse.julialang.org/t/interactive-abm-plot-with-agents-and-glmakie/98913 "2023-05-16T07:59:55Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![sea\_slug](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sea_slug/32/52907_2.png) [@sea\_slug](https://discourse.julialang.org/u/sea_slug)
#### Post date: [May 16, 2023, 7:59am UTC](https://discourse.julialang.org/t/interactive-abm-plot-with-agents-and-glmakie/98913/1 "2023-05-16T07:59:56Z")

</div>

I am trying to produce an interactive plot of an agent based model using `GLMakie`. I Have done this before no problem (a few months ago), but now when I run the code it just produces a static plot in VSCode.

I have been trying to get it working using the [wolf-sheep tutorial](https://juliadynamics.github.io/Agents.jl/stable/examples/predator_prey/) but no joy… before spending excessive time trying to figure out the issue I thought I’d ask here in case something has changed recently that I have missed?

Any advice would be much appreciated!

---

<div class="post-metadata">

### Author: ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)
#### Post date: [May 16, 2023, 8:00am UTC](https://discourse.julialang.org/t/interactive-abm-plot-with-agents-and-glmakie/98913/2 "2023-05-16T08:00:56Z")

</div>

> <https://github.com/MakieOrg/Makie.jl/issues/2956#issuecomment-1549158983>
>
> In the most recent update (GLMakie 0.8.5 on Julia version 0.9.0) GLMakie no long…er opens a separate window when executing from a file in Visual Studio Code (Julia extension also on the latest version). Instead, plots open in a new tab in VS Code, like CairoMakie. I tested with a new environment with only GLMakie installed and generating a blank \`Figure()\`. I'm not sure if it's a Makie or VSC problem.

---

<div class="post-metadata">

### Author: ![sea\_slug](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sea_slug/32/52907_2.png) [@sea\_slug](https://discourse.julialang.org/u/sea_slug)
#### Post date: [May 16, 2023, 9:32pm UTC](https://discourse.julialang.org/t/interactive-abm-plot-with-agents-and-glmakie/98913/3 "2023-05-16T21:32:42Z")

</div>

Thanks @sdanisch , great package!

For anyone else, from the GitHub issues page @sdanisch linked. You just need to do the following to get the separate interactive plotting window: `GLMakie.activate!(inline=false)`.

---

<div class="post-metadata">

### Author: ![PaoloBova](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paolobova/32/19906_2.png) [@PaoloBova](https://discourse.julialang.org/u/PaoloBova)
#### Post date: [December 17, 2023, 11:26am UTC](https://discourse.julialang.org/t/interactive-abm-plot-with-agents-and-glmakie/98913/4 "2023-12-17T11:26:19Z")

</div>

The solution above didn’t work for me on its own. I also needed to call `display` on the created figure before the interactive plotting window would appear (I was using vscode on Linux Ubuntu 22.04).
