我正在尝试复制一个简单的例子gganimate
from here https://gganimate.com/articles/gganimate.html。问题很简单ggplot
部分工作正常,但是当我添加时transition_states
rstudio
开始渲染,然后保存一堆gganim_plotXXXX.png
文件并且不显示预期的动画。
第一个问题显然是:我是否做错了什么导致动画不起作用?
第二个问题是:保存一堆 .png 文件的标准是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
我运行了你的代码并得到了这个错误:
l$setup_layer(d,plot) 中的错误:尝试应用非函数
然后,我安装了png https://cran.r-project.org/web/packages/png/index.html and gifski https://cran.r-project.org/web/packages/gifski/index.html打包并重新启动 R-Studio。它正在发挥作用。我想,你可以试试这个。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)