How to display dynamic value for each agent in interactive plot

Christopher_Fisher
Tue, 24 Mar 2026 12:47:02 +0000
General Usage

Hello,

I am using Agents.jl and I would like to plot a value for each agent dynamically with abmplot with enable_inspection = true. This example shows how to generate a static plot of this variety (here is the plot). But its not clear to me how this can be done.

Specifically, if I have in pseudo-code:

fig, ax, abmods = abmplot(..., enable_inspection = true)
widget_layout = fig[end + 1, :] = GridLayout()
plot_layout = widget_layout[1,1] = GridLayout()
ax_plot = Axis(plot_layout[1,1])
# throws error cannot convert Vector{Float64} to Float64
lines!(ax_plot, @lift(Point2f.($(abmods.mdf).time, $(abmods.mdf).beliefs)))

How do I modify the last line to support Vector{Float64}? I can add a runnable version of the code if that would be helpful.

6 posts - 3 participants