gganimate图不显示并保存一堆.png [英] gganimate plot not showing and saving bunch of .png's
问题描述
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?
第二个问题是:为 gganimate
保存一堆.png文件是标准的吗?
Second question is: Is saving bunch of .png files standard for gganimate
?
预先感谢
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
推荐答案
我运行了您的代码并收到此错误:
I ran your code and got this error:
l $ setup_layer(d,plot)中的错误:尝试应用非功能
Error in l$setup_layer(d, plot) : attempt to apply non-function
然后,我安装了 png
和 gifski
打包并重新启动R-Studio.工作正常我想,您可以尝试一下.
And then, I installed the png
and gifski
packages and restart the R-Studio. It's working. I think, you can try this.
这篇关于gganimate图不显示并保存一堆.png的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!