I am able to record an animation of a figure in Makie using record
. I can check if the figure is correctly updated in the animation by playing the movie file after the recording finishes. However, animation creation usually takes time because it requires the whole iteration. So, I would like to monitor the evolution of the figure while the animation is being generated.
I thought this can be easily done by putting display(fig)
in the record
loop, but it didn’t work. Here is an example:
using CairoMakie
xs = range(0, 2π, 100)
fig = Figure()
record(fig, "test_record.mp4", 0:5) do n
empty!(fig)
fig[1,1] = Axis(fig, limits=(0,2π,-1,1))
lines!(xs, sin.(n .* xs))
# display(fig)
#
# The above line
# - either crashes the integrated REPL when runs in VScode,
# - or does not update the figure when runs in terminal.
end
How can I display the evolution of a figure while the evolution is being recorded?