Saves an animation object produced by animate_3d() to a file.
If no animation is provided, saves the most recently rendered animation.
Arguments
- animation
An animation object from
animate_3d(), orNULLto use the last rendered animation.- filename
Output file path.
Examples
if (FALSE) { # \dontrun{
p <- ggplot() +
geom_function_3d(
fun = function(x, y) sin(x) * cos(y),
xlim = c(-pi, pi), ylim = c(-pi, pi),
fill = "steelblue", color = "steelblue") +
coord_3d()
animate_3d(p, yaw = c(0, 360))
anim_save_3d(filename = "my_animation.gif")
} # }
