gganimate图不显示并保存一堆.png [英] gganimate plot not showing and saving bunch of .png's

查看:74
本文介绍了gganimate图不显示并保存一堆.png的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从这里.问题很简单, ggplot 部分工作正常,但是当我添加 transition_states rstudio 开始渲染,然后保存一堆 gganim_plotXXXX.png 时,问题就解决了代码>文件,并且不显示预期的动画.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆