gganimate doesn't match the normal plot

I am trying to animate a ggplot, but the animation doesn't match the normal plot. It skips some of the geom_points. I have three columns start_date, country, and total. I want to animate the total according to start_date, and all the countries should start from 1. Thanks


Screen Shot 2022-11-24 at 9.55.55 AM

anim <- country_total %>% ggplot(aes(x = country_total$country, y= country_total$total, Label = country))+
  geom_point(size = 5)+
  coord_flip()+
  labs(x= "Countries with more than 6 shutdowns", y= "Count", caption = paste("Total number of shutdowns by: {frame_time}")) +
  transition_time(start_date)+
  #ease_aes("linear")+
  shadow_mark(past = T, future=F, alpha=0.3)+
  theme(panel.background = element_blank(),
         plot.caption= element_text(size=20,
                                   color="red",
                                   face="bold",
                                   vjust = 20)
        )+
  scale_y_discrete(limits = c(1, 500))
  #geom_text(aes(label = count, vjust = -50))+
animate(anim, width=1600, height=600, renderer = gifski_renderer(loop = FALSE))

Hello.
Thanks for providing code , but you could take further steps to make it more convenient for other forum users to help you.

Share some representative data that will enable your code to run and show the problematic behaviour.

You might use tools such as the library datapasta, or the base function dput() to share a portion of data in code form, i.e. that can be copied from forum and pasted to R session.

Reprex Guide

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.