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
2
votes
1 answer

Issue with gganimate and (sometimes) empty facets

I'm observing some behavior in gganimate that I cannot explain, and I would like to understand what I am doing wrong (or whether it is a bug). For example, here is a very simple dataset and a plot of it: library(dplyr) # dplyr_0.7.8 library(tidyr) #…
banbh
  • 1,331
  • 1
  • 13
  • 31
2
votes
0 answers

gganimate error : identical(classes, col_classes(to)) is not TRUE

I can't use transitions from the gganimate package due to how I've set up my colors from group to group. My data is organized by Team, Season, Rank, Primary color, Secondary Color: Team,Season,Rank,Primary,Secondary Washington…
Adam Bunn
  • 63
  • 5
2
votes
1 answer

remove straight line and set label/title to month name instead number using ggplot + gganimate

I have geom_line plot (using airquality data for reproducible example) showing temperature changes, a line per month, and then gganimate this way: library("tidyverse") library("gganimate") data("airquality") ggplot(airquality, aes(Day, Temp, color…
Forge
  • 1,587
  • 1
  • 15
  • 36
2
votes
0 answers

custom column to frame title in gganimate

I would like to use a custom column in gganimate title but couldn't read anywhere in docs how to do it. Example using the code from their page: library(gapminder) ggplot(gapminder, aes(gdpPercap, lifeExp, size = pop, colour = country)) + …
useRj
  • 1,232
  • 1
  • 9
  • 15
2
votes
1 answer

Creating a smooth transition between two time series bar charts with gganimate

I am attempting to make an animation with gganimate that starts with the past 10 years of crime data. Once the animation starts, I would like to add historical years going back to 1970 (when crime was much higher). This would appear as a "zoom out"…
John Hall
  • 23
  • 3
2
votes
2 answers

Save gganimate animation as mp4 file

Is there a way of saving the movies produced with ffmmeg_renderer or av_renderer as separate files? I always get theme embedded as data in the html file.
Erich Neuwirth
  • 943
  • 7
  • 13
2
votes
0 answers

Countries moving around when using gganimate

I'm animating a map with percentage of deaths in Africa caused by HIV/AIDS. For some years the animation works well, but for other years the countries are sort of jumping around. The data can be found here. My code is shown…
2
votes
1 answer

Values in gganimate col chart differs from original data values

I'm starting with animated charts and using gganimate package. I've found that when generating a col chart animation over time, values of variables change from original. Let me show you an example: Data <- as.data.frame(cbind(c(1,1,1,2,2,2,3,3,3), …
Mikelof
  • 21
  • 2
2
votes
1 answer

R ggplot2 & gganimate: animation changes at end

I am trying to create this figure that animates over time using the gganimate library, going from the 'baseline' timepoint to the 'late' timepoint'. However for some reason, the image changes between frames 22-24 and again between 42-44. It throws…
Radwa Sharaf
  • 159
  • 14
2
votes
1 answer

How to add a moving vline to gganimate in addition to the animated histogram?

I am trying to add a line to my animation, but I couldn't make it work using the concept of frame. This is a reproducible example: df <- read.table(header = TRUE, text = 'key value bins maxIntensity A 4 0 1 A 1 1 1 A …
Azim
  • 1,596
  • 18
  • 34
2
votes
1 answer

Change speed of R ggplot gganimate when using rmarkdown render

I have some ggplot objects animated via gganimate, and I would like to change the speed of the animation. Here is a reproducible example from the github repo here:…
jmuhlenkamp
  • 2,102
  • 1
  • 14
  • 37
2
votes
1 answer

tweenr/gganimate with time series line plot

first I created an animated plot for a very simple time series line plot… Some example data: library(dplyr) library(gganimate) library(tweenr) data <- tribble( ~year, ~num, 1950, 56, 1951, 59, 1952, 64, 1953, 67, 1954, 69, 1955, 74, …
Ryo-N7
  • 51
  • 7
2
votes
1 answer

Animated plot with polar coordinates

I'm trying with ggplot2 to create an animated pie plot. My data is a bit complex but here is a simplified example : ex = data.frame(cat=c("cat1","cat2","cat1","cat2","cat1","cat2"), f = c(70,30,60,40,50,50), t=c(1,1,2,2,3,3)) ex$t = factor(ex$t) p…
Pad
  • 33
  • 3
2
votes
1 answer

ggplot2 and gganimate: How to make an animated line change colors depending on Y axis values

I want the animated line in my plot to change colors when it goes above 50%, to show the difference in outcomes. My "data.thesis" frame looks like this: My hypothetical outcome plot is here. The code will animate the plot so that the black line…
2
votes
1 answer

Gif/Mp4 quality using R animation/gganimate package different across Linux/Windows operating systems

Using the same code script, R/Imagemagick produces outputs of different image quality depending on the operating system that runs the script. Notably, the geoms and text in the windows version are noticeably more pixelated. Here are links to the…
Michael Lee
  • 323
  • 2
  • 11