# Issues with abm visualization

**URL:** https://discourse.julialang.org/t/issues-with-abm-visualization/83739
**Category:** Visualization
**Tags:** agents
**Created:** [July 4, 2022, 11:25am UTC](https://discourse.julialang.org/t/issues-with-abm-visualization/83739 "2022-07-04T11:25:20Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Fatima](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fatima/32/37094_2.png) [@Fatima](https://discourse.julialang.org/u/Fatima)
#### Post date: [July 4, 2022, 11:25am UTC](https://discourse.julialang.org/t/issues-with-abm-visualization/83739/1 "2022-07-04T11:25:21Z")

</div>

Hi,  
I’m trying to visualize my agents moving, however, I keep running into this error:  
MethodError: Cannot `convert` an object of type Tuple{Int64} to an object of type GeometryBasics.OffsetInteger{-1, UInt32}

The image I have loaded into my script is .bmp file of dimensions (2337, 3377). I made sure to update abm\_video to abmvideo, but am still facing problems.

These are my inputs:  
begin  
CairoMakie.activate!()  
static\_preplot!(ax, model) = scatter!(ax, model.goal; color = (:red, 50), marker = ‘x’)  
abm\_video(  
“maze.gif”,  
model,  
agent\_step!;  
resolution=(2337, 3377),  
frames=1200,  
framerate=30,  
ac=:red,  
as=11,  
heatarray = \_ → pathfinder.walkmap,  
add\_colorbar = false,  
)  
end

Advice would be much appreciated.  
Thanks in advance.

---

<div class="post-metadata">

### Author: ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)
#### Post date: [July 4, 2022, 11:32am UTC](https://discourse.julialang.org/t/issues-with-abm-visualization/83739/2 "2022-07-04T11:32:45Z")

</div>

please see [Please read: make it easier to help you](https://discourse.julialang.org/t/please-read-make-it-easier-to-help-you/14757) for us to help you, specifically

- format code
- provide actually runnable code (what’s `model`?)
- provide a minimal working example
- provide stacktrace

---

<div class="post-metadata">

### Author: ![garrek](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/garrek/32/27937_2.png) [@garrek](https://discourse.julialang.org/u/garrek)
#### Post date: [July 5, 2022, 12:39am UTC](https://discourse.julialang.org/t/issues-with-abm-visualization/83739/3 "2022-07-05T00:39:36Z")

</div>

I’m not exactly sure where the error is coming from, but my guess is the `resolution` keyword argument is not part of `abmvideo`. I think you have to specify this in the beginning when making your figure

```julia
fig = Figure(resolution = ( ))

```

From the docs, it seems you can also use the `figure` keyword argument like this ([example here](https://juliadynamics.github.io/InteractiveDynamics.jl/dev/agents/#Creating-custom-ABM-plots-1))

```julia
abmvideo(file, model, agent_step!; figure = (; resolution = (,))

```

Another issue is that you should be using GLMakie (which uses the GPU for interactivity) instead of CairoMakie (which is used for static plots).

---

<div class="post-metadata">

### Author: ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)
#### Post date: [July 5, 2022, 4:48am UTC](https://discourse.julialang.org/t/issues-with-abm-visualization/83739/4 "2022-07-05T04:48:44Z")

</div>

Note that a video is not “interactive”, it’s just a sequence of static images and cairomakie can do that fine.

---

<div class="post-metadata">

### Author: ![garrek](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/garrek/32/27937_2.png) [@garrek](https://discourse.julialang.org/u/garrek)
#### Post date: [July 5, 2022, 5:01am UTC](https://discourse.julialang.org/t/issues-with-abm-visualization/83739/5 "2022-07-05T05:01:01Z")

</div>

I learned a thing.

---

<div class="post-metadata">

### Author: ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)
#### Post date: [July 5, 2022, 9:07am UTC](https://discourse.julialang.org/t/issues-with-abm-visualization/83739/6 "2022-07-05T09:07:23Z")

</div>

yeap all videos in the docs of Agents.jl are done with CairoMakie 😉
