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

Gradually change colour of polygon with gganimate

I'm trying to create an animation where an object is drawn whilst gradually changing its colour. For illustrative purposes assume that the object I want to draw is a circle. What I have so far I create a dataset that contains the coordinates of my…
tivd
  • 750
  • 3
  • 17
2
votes
1 answer

Animation time with gganimate

I want to make a plot animate. I need that the points appear and disappear, but only make that the movements of points. set.seed(1) library(tidyverse) library(gganimate) df <- tibble( x = rnorm(100) , y = rnorm(100) , size = rep(c(2, 3, 4, 5),…
2
votes
1 answer

How to open animated plots (gif/mp4) in RStudio?

I'm using RStudio with the {gganimate} package in a restricted research environment (a Windows 10 VM with several modifications) to create animated graphs in .gif and .mp4 formats - when they are rendered within RStudio they display fine, but if I…
jsavn
  • 701
  • 1
  • 8
  • 17
2
votes
0 answers

R; displaying a gganimate .mp4 file in shiny

The.gif displays correctly, but .mp4 displays a missing file icon. Following the attempt…
R_Pseudo
  • 146
  • 5
2
votes
1 answer

Arguments imply differing number of rows in R - Specific Case

I have two data files at the following links: tuckdf and tgames. I also have the following code to create an animation using these…
lowlyprogrammer
  • 428
  • 3
  • 15
2
votes
1 answer

Can you have a rolling window filter in gganimate?

I am looking to have each frame of a scatter plot be filtered by another vector with a certain bin width and have it it roll through those. For example I can do this by: library(ggplot2) library(gganimate) #example data iris <-…
Henry Holm
  • 495
  • 3
  • 13
2
votes
1 answer

How can I animate points on a spatial map with gganimate, sf, and ggplot2?

I'm having some trouble with animating some points on a spatial map. For some reason, only about half of the points show up in the animation. In the static plot, I can clearly see all the points. How can I make sure that the gganimation shows all…
Nick
  • 123
  • 10
2
votes
0 answers

Empty plot with ggplot + ggridges + gganimate

I'm getting an animation with empty canvas when using ggridges. library(ggplot2) library(ggridges) library(gganimate) df = data.frame(id = rep(1:5, each = 10), t = rep(1:10, 5), y = runif(50)) p1 = ggplot(df, …
mattek
  • 903
  • 1
  • 6
  • 18
2
votes
0 answers

glitches in animation made with gganimate

I can't tell if I have an R or a computer issue. When I recreate the demo on gganimate's webpage: library(gganimate) p <- ggplot(iris, aes(x = Petal.Width, y = Petal.Length)) + geom_point() anim = p + transition_states(Species, …
invictus
  • 1,821
  • 3
  • 25
  • 30
2
votes
1 answer

Animating scales parameter

I'm looking for an elegant/concise way to produce an animation in R that shifts a parameter in a transformation of my y scale. Let's say I have this data and chart: library(tidyverse); library(gganimate); library(scales) my_data <- tibble(time =…
Jon Spring
  • 55,165
  • 4
  • 35
  • 53
2
votes
1 answer

R: Error when installing package "gifski"

I hope you're staying well. I am trying to install the gifski package so that I can run tmap_animation(). Here's the error message I see: Installing package into ‘/nfs/cfs/home4/wmjl/wmjlwuh/R/x86_64-pc-linux-gnu-library/4.0’ (as ‘lib’ is…
wusterw
  • 31
  • 1
2
votes
2 answers

How can I use gganimate with geom_tile?

I was having trouble animating a geom_tile() plot where the tile remains visible after it appears. Here's my code using the airquality data. First, the static plot. Here, the x-axis is Day. The y-axis is Month and Temp is the…
FR_Data
  • 23
  • 3
2
votes
1 answer

Adding list outside of ggplot2 which changes as time progresses - gganimate

I have created an animated plot using ggplot2 and then gganimate. The plot shows points changing in time and I have highlighted in red, a point of interest, and in yellow, points that stick around with the red point over time. I am trying to have…
user9317212
2
votes
0 answers

gganimate transition_event with date-time data

I'm animating a map of NY fire calls last Thanksgiving using gganimate. My data is here; it has type of call, location of call, time the call was put in, and time the call was resolved. (I convert the latter two to POSIXct variables.) I'd like a map…
2
votes
0 answers

Issue with colour fill with gganimate and geom_sf

I'm having a problem with gganimate where it does not fill the geom_sf points I am using all of the time. A static version of the plot I'm using works fine: precincts$margingroup <- cut(precincts$margin, breaks = breaks,…