【问题标题】:gganimate does not show anythinggganimate 不显示任何内容
【发布时间】:2019-08-11 11:45:35
【问题描述】:

由于我的消息,我已经安装了 transformrgifski 软件包。为什么下面的代码不起作用?我收到很多消息:

geom_path: Each group consists of only one observation. Do you need to adjust the group aesthetic?

library(gapminder)
library(gganimate)
library(gifski)
library(transformr)
library(dplyr)   # For %>%  and  filter  and  %in%
library(ggplot2) 

gapminder %>% 
  filter(country %in% c("Afghanistan", "United States")) %>% 
  ggplot() +
  geom_line(aes(year, pop, group=country)) + 
  transition_time(year)

【问题讨论】:

    标签: r ggplot2 gganimate


    【解决方案1】:

    我已经解决了这个问题。我需要使用transition_reveal 而不是transition_time

    【讨论】:

    • 我不知道为什么会这样,但我可以确认这行得通……很高兴能理解为什么!
    猜你喜欢
    • 1970-01-01
    • 2012-09-29
    • 2020-11-10
    • 2012-04-12
    • 2019-11-11
    • 2017-09-25
    • 2012-08-02
    • 2018-06-25
    • 2018-07-14
    相关资源
    最近更新 更多