Makie update multiple arguments simultaneously

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)
for i in 10:20
    push!(len, i)
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?

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