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

Animate / dynamically change custom plot annotation gganimate with relation to transition states

How can I dynamically change a custom plot annotation in gganimate with relation to transition states, similar to Change label of gganimate frame title, but the annotation should be placed within the plot panel. Animated barplot via gganimate:…
tjebo
  • 21,977
  • 7
  • 58
  • 94
3
votes
1 answer

gganimate transition_reveal() with geom_line() breaking on the final frame?

I am trying to animate a line graph with multiple lines. It seems that there is an error with the gganimate package involving transition_reveal() that is causing the final frame to revert for all of the lines but one. This error is not present when…
ddeann
  • 31
  • 2
3
votes
1 answer

Getting transition_states, geom_label_repel and enter_fade to work together

I'm drawing a scatterplot where I'd like to highlight different observations as time passes. Sometimes, these observations are close together, so I'm using geom_label_repel to do so. I'd also like to use enter_fade and exit_fade in order to make…
markrt
  • 97
  • 5
3
votes
2 answers

How to show the current value of y-axis in gganimate?

I have a dataframe df: df = data.frame(name = "bird", value = seq(0, 1, length.out = 100), step = 1:100) I want to animate this data by showing the variable value increasing. In the animation, I want to show the current step…
bird
  • 2,938
  • 1
  • 6
  • 27
3
votes
1 answer

gganimate not showing title with Date when using current_frame or frame_time

I am creating an animation with gganimate but I need to show the date on title. My data df (dput() included at the end) is small and the animation works fine when I do not show the title with date but I need to include it. Here is the code I…
Duck
  • 39,058
  • 13
  • 42
  • 84
3
votes
1 answer

Using geom_map with transition_time gets Error: Error in insert_points(polygon$x, polygon$y, splits, n)

I'm trying to show the growth of COVID cases in New York state This code gets the plot I want but without the animation or aspect of time. Full error: Error in insert_points(polygon$x, polygon$y, splits, n): Not compatible with requested type:…
Kyle DePace
  • 156
  • 7
3
votes
1 answer

Simultaneously move all geom bars according to vote percentage

I am not able to move all the bars. How do I achieve it? All the bars should start from 0 and move to there desired swing percentage. library(ggplot2) library(dplyr) library(gganimate) theme_set(theme_bw()) #data <-…
Daman deep
  • 631
  • 3
  • 14
3
votes
1 answer

How to stop gganimate after one loop of animation

Is it possible to stop after one loop of animation? Animation should be performed until last year 2021 then stop showing all bars! Here is an example animation of bars with gganimate: library(tidyverse) library(gganimate) year <-…
TarJae
  • 72,363
  • 6
  • 19
  • 66
3
votes
1 answer

R : geom_text() goes wrong with gganimate

The geom_text() function doesn't appear properly in gganimate. gganimate prints correctly the labels for the lineplot but not for the barcharts. How can I solve the problem, please ? Is there an other way to print the values on my plot with…
salwa
  • 47
  • 5
3
votes
1 answer

Is there a way to draw a vertical line using geom_abline?

(Context: I'm using the soc.ca package and hoping to illustrate the differences in angles between the overall MCA results and each of the class-specific results.) I have a data frame of pairs of slopes, and I'm hoping to illustrate how they differ…
markrt
  • 97
  • 5
3
votes
1 answer

End Animation after Appearing

I made an animation from my data and managed to give it a good seize/resolution for a powerpoint presentation. I would like the bars in the barchart to appear and then end the animation. I can't find the proper settings in gganimate to make the…
BanffBoss122
  • 149
  • 9
3
votes
0 answers

animate a ternary plot

I'm trying to animate a time-series of ternary plots made with ggtern. I'd like to animate the 'time' variable but am getting the error Error: Mapping must have 3 unique named variable pairs # Get ternary data: df=data.frame(x=c(.7,.1,.3), …
smm
  • 75
  • 4
3
votes
2 answers

How to make the transition time between 2 frames longer in gganimate

I am using gganimate to create animations of multiple frames of scatter plot with each frame corresponding to one year. I want to emphasize the change between two particular consecutive frames so that these two frames stand out frame other frames.…
Patrick
  • 1,057
  • 9
  • 23
3
votes
1 answer

R stuck on rendering in anim_save

I try to run this code below. The issue I ran into is that if I do not set a width and height it saves, if I set width and height it is stuck in running without ever saving (I tried letting it run for a day). I also tried the code on multiple…
J.Karl
  • 45
  • 4
3
votes
2 answers

How do I use gganimate on a bar plot so each bar that appears doesn't disappear until the animation ends?

Each bar appears and then disappears before the next one does. I'm copying the code I'm using here: library(ggplot2) library(gganimate) med_age <- c(18,31,31,33,35,42) continent <- c("Africa","South America","Asia","North & Central…
Renthu
  • 47
  • 3