Questions tagged [gganimate]

gganimate is a package for R that allows to produce animated graphics with ggplot2. It is based on the animation package.

gganimate is a package for R that allows to produce animated graphics with ggplot2. It is based on the animation package.

Repositories:

549 questions
4
votes
1 answer

How to create smooth transition between states in gganimate using geom_point?

I am trying to create an animated plot using gganimate. When I pass the following factor dat$period to transition_states, I get 3 static images. I would prefer to have the points "move" from state-to- state. Here is my code: plot <- …
mdb_ftl
  • 423
  • 2
  • 14
4
votes
1 answer

Combining two animated plot into one GIF/MP4

I have created two animated time series charts based on the same dataset. One is a line chart showing the trend in the total, and one is a bar chart showing the top 5 sub-groups. I want to see if I can combine these into one time series animation,…
Keith McNulty
  • 952
  • 1
  • 6
  • 17
4
votes
0 answers

Rust compiler not found when installing gifski

I'm trying to install gifski which is a dependency for gganimate. I get this error. ------------------ RUST COMPILER NOT FOUND -------------------- Cargo was not found on the PATH. Please install cargo / rustc: - yum install cargo …
ivan
  • 93
  • 6
4
votes
1 answer

How to use geom_smooth() with gganimate

I'm struggling to understand how to use geom_smooth() together with gganimate. The reprex is available below. When running the plot statement excluding the transition_time function I visualize the static plot as expected. The issue appears when I…
jlopezper
  • 41
  • 6
4
votes
2 answers

Possible to animate polygon fill using gganimate in R?

I have county level data recording the year an invasive insect pest was first detected in that county between 2002 and 2018. I created a map using ggplot2 and the maps package that fills the county polygons with a color according to the year the…
Jake
  • 196
  • 1
  • 18
4
votes
1 answer

Problems with geom_text and pausing the animation

I'm trying to replicate the following code (thomasp85/gganimate). I have two problems: I don't want to show the labels (variable: partidos) of the first geom_point; I would like that once the animation ends, for a few seconds the labels…
majesus
  • 303
  • 2
  • 9
4
votes
1 answer

gganimate time series and two line plot

following the source code Here. I am trying to replicate it with my data. I have a time-series of data, where I'm plotting active and non-active number on the y-axis. here is my sample data structure: df <- tibble::tribble( ~Date, ~active,…
DanG
  • 689
  • 1
  • 16
  • 39
4
votes
0 answers

gganimate zoom in on data while keeping map as background doesnt work

I am trying to plot a path of gps points I have (the included example is a of a train ride in the Netherlands). I would like to make use of the shadow_mark() and view_follow() functions of the gganimate() package, such that the plot starts fully…
L Smeets
  • 888
  • 4
  • 17
4
votes
0 answers

Put several animations one after the other using gganimate

I usually generate a bunch of animations using gganimate and place them inside html to be shown on my reporting server. I would like to join all animations together instead of having a page for each one of them using R. I follow the answer to this…
useRj
  • 1,232
  • 1
  • 9
  • 15
4
votes
1 answer

Animated violin/boxplots plots with p-values for paired Wilcoxon tests

I am trying to add p values for paired wilcox test in R. I am using the following code. The code below creates violins (density distributions) of an outcome reading (bicep) for two diets (treatment). These violins are animated over time 1, time 2,…
DiscoR
  • 247
  • 2
  • 11
4
votes
1 answer

Rounding frame_time and smooth transitions for gganimate

I have the following data frame: # Seed RNG set.seed(33550336) # Create data frame df <- data.frame(x = runif(100), y = runif(100), t = runif(100, min = 0, max = 10)) I'd like to plot points (i.e., at x and y…
Dan
  • 11,370
  • 4
  • 43
  • 68
4
votes
2 answers

Cumulative plots in gganimate 0.9.9.9

I wasn't able to find a previously posted question that sufficiently answered this question. In previous posts, accepted answers have used shadow_mark to keep previously rendered layers persistent. How to keep previous layers of data while doing…
Alan Dursun
  • 655
  • 3
  • 14
4
votes
1 answer

gganimate animate multiple paths based on time

I have parsed some data on grenade throws from the videogame Counter Strike. The sample data beloew reveals that I have positions on where the grenade is thrown from and where the grenade detonates and when the grenade is thrown. df <-…
Bønding
  • 77
  • 6
4
votes
1 answer

Create a 'flyover' map animation using ggmap and gganimate

I have a dataset of people arriving in a location, how long they stayed, and their home locations. I want to create an animated chart which 'flies' them to their destination, and returns them to their original point once their trip is over. But…
Margaret
  • 5,749
  • 20
  • 56
  • 72
3
votes
1 answer

Reveal linear regression slopes one at a time using gganimate and ggplot

The below code makes a plot of the actual slope (the red line) produced by running linear regression using the entire mtcars data. The plot also shows all the slopes produced by using subsets of mtcars (black lines). But how can I show the slopes…
luciano
  • 13,158
  • 36
  • 90
  • 130