I have created three animations using gganimate
, from which I am trying to visualize the yearly trend of number of crimes in European countries.
The three plots are in my git repo Euro_Crime_Analysis_R under 5th section "Visualizing the data".
Links for datasets, actual data which I used & code (rmd file) are also in the same repo.
Question: How are the parameters transition_length
and state_length
in transition_states
command controlling the animated output?
I tried multiple combinations of each parameter and which I have used in my repo were the ones which gave a smooth animation. (and also attached the output of other combinations in this question)
Plotting each offence for each country in each year from 2008-2017: In this plot, the issue is the last frame where the animation stops, there are some blank chunks in some bars? What is causing that there?
Plotting the total number of offences in order (top 10) for each year: In this plot, when I tried with
transition_length = 10
,state_length = 1
, the last frame gets distorted like this plot2_distorted_o/pPlotting the total number of offences along with each type of offence in order (top 15) for each year: In this plot, for most parameter combinations I tried, the stacks in bars are transitioning with a lag and in last frame again everything is distorted. Outputs of combinations of
transition_length, state_length
are 10,20 & 1,3 respectively.