r - 为 gganimate 设置较慢的帧速率或较长的持续时间

标签 r ggplot2 gganimate

使用 gganimate 从 ggplot 制作动画时,我需要设置较低的速度以允许人们读取数据。

阅读文档(很难找到选项)似乎“nframes”是正确的设置。但我不能减慢动画或设置持续时间。两种方法中的任何一种都可以

library("gganimate")
library("tidyverse")

p <- ggplot(airquality, aes(Day, Temp, color = Month)) +
  transition_time(Month) +
  labs(title = 'Month is {frame_time}') +
  geom_path(aes(group = Month), size = 1)

animate(p, nframes = 100)

Error in device(files[i], ...) : unused argument (nframes = 100)

最佳答案

不确定为什么会收到该错误,但您可以在 animate() 中设置帧速率函数调用:

animate(p, nframes = 100, fps=3)

关于r - 为 gganimate 设置较慢的帧速率或较长的持续时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53543448/

相关文章:

r - gganimate 创建重复图像

r - 在函数内调用 glmulti 时未找到错误对象

R: is.nloptr(ret) 中的错误:x0 中的目标返回 NA

r - 如何摆脱渐变并在ggplot中使用单独的颜色?

r - 使用 ggplot 绘制具有两个 y 刻度的图形

r - 更改 ggplot2 中刻度的位置(在绘图内)

r - 在gganimate中以不同的速度显示不同的时间元素

r - 使用gganimate导出gif

r - 如何为 sparkR 运行 R 脚本?

r - 用多种颜色标记ggdendro叶子