title: Control speed of a gganimation
body: <p>I want to slow the transition speed between states when using <code>library(gganimate)</code>.</p>
  
  <p>Here is a mini example:</p>
  
  <pre><code># devtools::install_github("thomasp85/gganimate")
  library(gganimate) # v0.9.9.9999
  
  dat_sim &lt;- function(t_state, d_state) {
    data.frame(
      x = runif(1000, 0, 1),
      y = runif(1000, 0, 1),
      t_state = t_state*d_state
      )
  }
  
  dat &lt;- purrr::map_df(1:100, ~ dat_sim(., 1))
  
  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)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/Wohhd.gif" rel="noreferrer"><img src="https://i.stack.imgur.com/Wohhd.gif" alt="toofast"></a></p>
  
  <p>My ideal behavior would be much slower (10-100x), so color changes gradually evolve and nobody has a seizure.</p>
  
  <p>If I try to use <code>transition_states()</code> for more manual control, I get a gif with mostly blank frames. I've tried various combinations for <code>transition_legnth=</code> and <code>state_length=</code> without a noticeable effect.</p>
  
  <pre><code>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_states(t_state, transition_length = .1, state_length = 2)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/cU41b.gif" rel="noreferrer"><img src="https://i.stack.imgur.com/cU41b.gif" alt="mostlyblank"></a></p>