tylermorganwall / rayshader

R Package for 2D and 3D mapping and data visualization
https://www.rayshader.com/
2.05k stars 211 forks source link

how to make a moving ggplot and save into gif #62

Closed TonyFly3000 closed 5 years ago

TonyFly3000 commented 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()

tylermorganwall commented 5 years ago

render_movie() is the function you are looking for.

dieghernan commented 3 years ago

See #150 for an approach that converts the movie onto a gif with magick package