gganimate plot not showing and saving bunch of .png's

白昼怎懂夜的黑 提交于 2020-12-09 18:33:21

问题


I am trying to replicate a simple example about gganimate from here. The problem is simple ggplot part works fine but when I add transition_states rstudio starts rendering and then saves bunch of gganim_plotXXXX.png files and doesn't show the expected animation.

First question is obviously: Am I doing something wrong so that animation doesn't work?

Second question is: Is saving bunch of .png files standard for gganimate?

Thanks in advance

library(gganimate)

p <- ggplot(iris, aes(x = Petal.Width, y = Petal.Length)) + 
         geom_point()

anim <- p + 
  transition_states(Species,
                    transition_length = 2,
                    state_length = 1)
anim

回答1:


I ran your code and got this error:

Error in l$setup_layer(d, plot) : attempt to apply non-function

And then, I installed the png and gifski packages and restart the R-Studio. It's working. I think, you can try this.



来源:https://stackoverflow.com/questions/59664377/gganimate-plot-not-showing-and-saving-bunch-of-pngs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!