Control speed of a gganimation

后端 未结 1 1472
礼貌的吻别
礼貌的吻别 2020-12-10 02:23

I want to slow the transition speed between states when using library(gganimate).

Here is a mini example:

# devtools::install_github(\"t         


        
相关标签:
1条回答
  • 2020-12-10 02:52

    I found in docs animate function which can take fps and detail parameters.

    @param fps The frame rate of the animation in frames/sec

    @param detail The number of additional frames to calculate, per frame

    The result:

    p <- ggplot(dat, aes(x, y)) +
          geom_hex(bins = 5) +
          theme_void() +
          lims(x = c(.3, .7),
               y = c(.3, .7)) +
          theme(legend.position = "none") +
          transition_time(t_state)
    animate(p, fps=1)
    

    Also there you can specify output format such as png, jpeg, svg.

    0 讨论(0)
提交回复
热议问题