animate() compiles a plot carrying a transition_states() into one keyframe
scene per state, training the scales once over all states and freezing them,
and returns a vellum_animation. Write it with anim_save(); printing it
shows the first keyframe as a preview.
Arguments
- plot
A PlotSpec with a
transition_states()(and optionally anease_aes()).- nframes
Total number of frames to render.
- fps
Frames per second (the playback rate written into the file).
Details
Per-state statistics (e.g. a smooth) are recomputed per keyframe, but no scale domain retrains — the frozen scales are the observable proof the animation stayed non-reactive (axis breaks do not move between frames).
Examples
if (FALSE) { # \dontrun{
vplot(mtcars) |>
mark_point(x = wt, y = mpg) |>
transition_states(cyl) |>
animate(nframes = 50, fps = 25)
} # }
