Closed TonyFly3000 closed 5 years ago
how to make a moving ggplot and save into gif ?
I try this ,but the plot does not move automatically :
library(rayshader) library(ggplot2) gg = ggplot(diamonds, aes(x, depth)) + stat_density_2d(aes(fill = stat(nlevel)), geom = "polygon", n = 100,bins = 10,contour = TRUE) + facet_wrap(clarity~.) + scale_fill_viridis_c(option = "A") plot_gg(gg,multicore=TRUE,width=5,height=5,scale=250)
render_camera()
render_movie() is the function you are looking for.
See #150 for an approach that converts the movie onto a gif with magick package
magick
how to make a moving ggplot and save into gif ?
I try this ,but the plot does not move automatically :
library(rayshader) library(ggplot2) gg = ggplot(diamonds, aes(x, depth)) + stat_density_2d(aes(fill = stat(nlevel)), geom = "polygon", n = 100,bins = 10,contour = TRUE) + facet_wrap(clarity~.) + scale_fill_viridis_c(option = "A") plot_gg(gg,multicore=TRUE,width=5,height=5,scale=250)
render_camera()