Makie update multiple arguments simultaneously

#1

I want to plot lines, which vary over time. I tried the following code:

using Makie

len = Node(10)
sx = lift(randn, len)
sy = lift(randn, len)
p = Scene()
lines!(p, sx, sy)
display(p)
for i in 10:20
    sleep(0.1)
    push!(len, i)
end
DimensionMismatch("arrays could not be broadcast to a common size")
...

I guess the problem is, that when observables are updated, there is a short moment, where sx has already the new length, while syis still has old length. How to solve this?

#2

You could try using an array of Points, where you push to or pop from the Array itself? Then pass a single Array into lines!

1 Like