I am using gganimate to create animations of multiple frames of scatter plot with each frame corresponding to one year. I want to emphasize the change between two particular consecutive frames so that these two frames stand out frame other frames. But I am not sure how to do this.
Here is a sample of my data and code:
structure(list(x = 1:6, y = 2:7, year = c(2010L, 2010L, 2011L,
2011L, 2012L, 2012L)), class = "data.frame", row.names = c(NA,
-6L))
library(tidyverse)
library(gganimate)
p <- ggplot(data, aes(x, y))+
geom_point() +
transition_time(year) +
labs(title = "Year: {as.integer(frame_time)}")
p_anim <- animate(p, nframes = 30, fps = 4)
anim_save("myfig.gif", p_anim)
I want to make the transition time between 2011 and 2012 longer than the transition time from 2010 to 2011 so that the transition from 2011 to 2012 can be emphasize. I would like to ask if this is possible?
If the above approach is technically impossible or not a good idea to emphasize the two frames, I may want the 2011 and 2012 frame each to pause for a longer period of time than the 2010 frame. Again, how this could be achieved?
Thank you.
###############################################################################
Above is a sample data. I have attached my real data here. For my real data, I want to specifically emphasize how points change from 2009 to 2010 while creating an animation from 1990 to 2019.
I tried TarJae's method of transition_states and ease_aes('cubic-in-out') on my real data, but the outcome is not ideal. I want to create an animation that slows down at 1990 and 2019, whether making this two frames stay longer or making the transition between these two frames much slower than transition between other frames. I also need to save the figure as video or gif, with publication-level resolution. Any suggestion on the real data is welcome. Thank you.