2

I am developing a gganimate animation that shows the data points over time between two metrics, x and y, with a line chart trailing behind them showing 'where you've been'. Something along the lines of this:

library(ggplot2)
library(gganimate)
library(dplyr)
library(gapminder)

gm <- gapminder %>%
  filter(continent == 'Oceania') %>%
  ggplot(aes(x = gdpPercap, y = lifeExp, group = country, col = country)) +
  geom_line() +
  geom_point(aes(size = pop), show.legend = FALSE, alpha = 0.7) +
  scale_size(range = c(2, 12)) +
  scale_x_log10() +
  theme_bw() +
  transition_reveal(year) +
  #labs(title = "Year: {frame_time}") +
  NULL

animate(gm, end_pause = 10)

Which creates this animation: enter image description here

There's something weird about the end_pause frame, though. For some reason, all of the visible dots except one disappear, leaving only the trails:

enter image description here

How do I get all of them to stay, not just the one?

Z.Lin
  • 28,055
  • 6
  • 54
  • 94
Margaret
  • 5,749
  • 20
  • 56
  • 72
  • 2
    This is caused by a change in the code for `transition_reveal` in 1.0.8, that aimed to fix a [different issue](https://github.com/thomasp85/gganimate/issues/409) but inadvertently caused this one. My [original workaround](https://stackoverflow.com/a/64135523/8449629) should still work for your case. I'll report this on GitHub. – Z.Lin Apr 01 '23 at 03:55
  • 1
    [Reported](https://github.com/thomasp85/gganimate/issues/480) on GH with another workaround. Both seems to work for your example above. – Z.Lin Apr 01 '23 at 05:01

0 Answers0