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
3
votes
0 answers

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

I have a fairly simple problem where I want to create a gif which loops through departure_hour and colors the lines based on link volumes. One caveat is the number of rows between states (i.e. departure_hour) may be different. Here is the code I am…
dataanalyst
  • 316
  • 3
  • 12
3
votes
1 answer

How to fix the width of the plot in gganimate?

I have trouble setting the width of the plot when I animate it. So if I make a static plot for example using the library gapminder with a code like this: library(ggplot2) library(gganimate) theme_set(theme_bw()) library(gapminder) p <- ggplot( …
tumavee
  • 65
  • 1
  • 5
3
votes
1 answer

How can I left-align plot labels in a gganimate animation?

I want to align my plot labels (title, subtitle) to the left of my image, not the left of the plotting area, for a gganimate animation. This is possible with static charts by converting to a gtable and then modifying the layout. A different…
Matt Cowgill
  • 659
  • 4
  • 13
3
votes
1 answer

Animate geom_line() collapsing into geom_point()

I'd like to have an animation where some lines collapse into points, which are the mean value, to demonstrate that the lines can be summarised by the mean value. Something like this. First, set up the data, and the line plot: library(tidyverse) #…
Nick Tierney
  • 192
  • 1
  • 8
3
votes
0 answers

Unable to animate both geom_line and geom_point with gganimate

I'm doing an animated graph with ggplot2 and gganimate where geom_line and geom_point represent the same numeric data. It is a scatterplot in which I want the point data appear with animated transition, as well as displaying an underlying line…
3
votes
1 answer

Making an animation of the Bernoulli distribution using gganimate and getting an unexpected jump at p = 0.5

I'm practicing using gganimate and want to create something similar to this Shiny app but animated. I've had some success, but am getting a really weird error that I honestly cannot explain and was hoping someone could help me out. The rest of this…
Julian
  • 451
  • 5
  • 14
3
votes
1 answer

How to make dots in gganimate appear and not transition

I am using gganimate. Say I have this MWE: library(ggplot2) library(gganimate) ggplot(airquality, aes(Day, Temp)) + geom_point(color = 'red', size = 1) + transition_time(Month) + shadow_mark(colour = 'black', size = 0.75) I have one…
bill999
  • 2,147
  • 8
  • 51
  • 103
3
votes
1 answer

how to use gganimate package plot a dynamic map in R?

As I know gganimate has been in version 1.0.3,we can use transition_* function to plot a dynamic graph. But when I run following code ,there is an error : Error in `$<-.data.frame`(`*tmp*`, "group", value = "") : replacement has 1 row, data has…
Tao Hu
  • 287
  • 2
  • 12
3
votes
1 answer

gganimate over time using transition_time where time variable is NBA game clock

I'm trying to animate the movement of players and basketball in a single NBA game. In the NBA, the game clock starts at 12 minutes and decreases to 11:59minutes, 11:58, 11:57minutes, etc. Therefore, the dataset of one possession has a game_clock…
user8248672
3
votes
1 answer

Using a gtable object with gganimate

I'm producing a gif with gganimate, and I'd like to make some tweaks to the plot format that can only be accomplished by converting a ggplot object to a gtable. For instance, I'd like to change the position of the plot title so that it always…
bschneidr
  • 6,014
  • 1
  • 37
  • 52
3
votes
2 answers

Animated barplot via gganimate: Annotate box with changing text below plot

I want to create an animated barplot with the gganimate package. Below the barplot, I want to annotate a text box. The text within the box should change over time. The x-axis of the barplot should be moving (as specified by view_follow). However,…
Joachim Schork
  • 2,025
  • 3
  • 25
  • 48
3
votes
1 answer

Why does this gganimate code locked binding error?

I'm using gganimate for the first time and I'm just trying to run the example code from the github, which is this: library(ggplot2) library(gganimate) ggplot(mtcars, aes(factor(cyl), mpg)) + geom_boxplot() + # Here comes the gganimate…
matt_lnrd
  • 329
  • 1
  • 9
3
votes
1 answer

Animating persistent data points at irregular times

I am trying to animate data points to appear at specific times. The data points are not linked to each other, so there should be no trails to/from them. They should just appear at the appointed time and place. However, possibly due to the nature of…
ddessert
  • 53
  • 1
  • 6
3
votes
1 answer

Fix blurry/overlapping text when using gganimate

I'm having trouble creating high resolution files when using gganimate. The text in the charts comes out blurry, almost as if the text is being written for every new frame in the .gif. Is there a simple solution to this problem? I tried fiddling…
henryjean
  • 102
  • 9
3
votes
1 answer

How to gganimate a stacked bar graph?

I am trying to make a transition between four stacked bar graphs. The output is not quite what I expected and I haven't been able to figure if it's an error in my code or if it's a bug in gganimate R package. This is the data frame I use: df <-…
rdatasculptor
  • 8,112
  • 14
  • 56
  • 81