与gganimate重复打印

时间:2019-02-01 19:48:06

标签: r ggplot2 gganimate

我米试图建立与ggplot和gganimate组合的动画,但我m到处留在我的graph.The点打印件无法正常移动。感谢您的帮助。

我的代码

ggplot(newfile, aes(Date,  TotalReturn, color = Investor)) +
  geom_line(aes(size = 3)) +
  geom_point(aes(size = 6,alpha = 0.5)) +
  geom_text(aes(label=paste0(TotalReturn,"%")),
            hjust= -0.5, vjust=0,size = 6)+
  facet_grid(rows = vars(Investor)) +
  labs(title = 'Total Return, Quarter: {frame_along}') +
  theme(axis.title=element_text(face="bold.italic", 
                                size="12", color="brown"), 
        legend.position="none") + 
  transition_reveal(along =Date) +
  ease_aes('linear')

animate(qp, duration = 100)

gif

0 个答案:

没有答案