Skip to contents

Converts a ggplot2 plot object into a manimR scene that can be animated.

Usage

convert_ggplot_to_manim(
  plot,
  name = "ggplot_animation",
  animate_build = TRUE,
  duration = 2
)

Arguments

plot

A ggplot2 plot object

name

Scene name

animate_build

Whether to animate the plot being built

duration

Duration for build animation

Value

A Scene object

Examples

if (FALSE) { # \dontrun{
library(ggplot2)

p <- ggplot(mtcars, aes(mpg, wt)) +
  geom_point()

convert_ggplot_to_manim(p) %>%
  render()
} # }