r gganimate:transition_reveal(标题更改)

时间:2019-01-31 09:35:45

标签: r transition gganimate

我想使用gganimate创建一个transition_reveal动画,从而使标题沿当前显示的迭代变化。因此,开始时的标题为“ Date:2019-01-01”,然后在动画旁边逐渐适应并显示“ Date:2019-01-20”作为结束。

a <- seq(1,20,1)
b <- seq(1,40,2)
c <- seq(as.Date("2019-01-01"), as.Date("2019-01-20"), by="days")
db <- cbind(a,b,c) %>% as.data.frame()

p <- ggplot(db, aes(x = a, y = b)) +
  geom_path() +
  labs(title = "Date: {frame_time}") +
  transition_reveal(c)

animate(p, renderer = gifski_renderer(loop = FALSE), nframes = 90, fps = 30, height = 600, width = 1100, start_pause = 0)

当前,出现以下错误:

50: object 'fame_time' not found

0 个答案:

没有答案