# Animated graph using Makie not working with node\_size or arrow\_size

**URL:** https://discourse.julialang.org/t/animated-graph-using-makie-not-working-with-node-size-or-arrow-size/99997
**Category:** General Usage
**Tags:** plotting, makie
**Created:** [June 7, 2023, 12:11pm UTC](https://discourse.julialang.org/t/animated-graph-using-makie-not-working-with-node-size-or-arrow-size/99997 "2023-06-07T12:11:11Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Richard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/richard/32/50597_2.png) [@Richard](https://discourse.julialang.org/u/Richard)
#### Post date: [June 7, 2023, 12:11pm UTC](https://discourse.julialang.org/t/animated-graph-using-makie-not-working-with-node-size-or-arrow-size/99997/1 "2023-06-07T12:11:11Z")

</div>

Hi  
I’m taking first steps with Makie, trying to produce an animated network graph. There are three nodes and I want the edge width, arrow size and node size to vary according to supplied matrices. The static graph works with observables, but attempts to animate give error messages:

- ERROR: KeyError: key: node\_size not found (if I uncomment the first commented line in the record command)
- ERROR: KeyError: key: arrow\_shift not found (if I uncomment the second commented line in the record command).

Grateful for any help. MWE below:

```plaintext
using GraphMakie
using Graphs
using GraphMakie.NetworkLayout
using Random

Random.seed!(12345)
n = 10
lw = rand(n,6).*10 #line width
as = 5*lw # arrow size - this scaling gets a reasonable result
ns = rand(n,3).*100 # node size (radius pixels, so square root would make marker area map to size)

g = SimpleDiGraph(3); add_edge!(g, 1, 2); add_edge!(g, 1, 3); add_edge!(g, 2, 1); add_edge!(g, 2, 3); add_edge!(g, 3, 1); add_edge!(g, 3, 2);

# works ok
f, ax, p = graphplot(g; curve_distance=-.2, node_size=ns[1,:], edge_width = lw[1,:], arrow_size = as[1,:])

# Now using observables 
olw = Observable(lw[1,:])
oas = Observable(as[1,:])
ons = Observable(ns[1,:])
# works ok
f, ax, p = graphplot(g; curve_distance=-.2, node_size=ons, edge_width = olw, arrow_size = oas)

rows = 2:n
#works ok but not if I uncomment commented lines
record(f, "t_animation.mp4", rows; framerate = 2) do frame 
    olw[] = lw[frame,:]
# ons[] = ns[frame,:]
# oas[] = as[frame,:] 
end

```
