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

How to get complete, rather than partial, pie charts using gganimate

I have a problem when doing an animated pie chart with gganimate and ggplot. I want to have normal pies each year, but my output is totally different. You can see an example of the code using mtcars: library(ggplot2) library(gganimate) #Some…
RRuiz
  • 2,159
  • 21
  • 32
2
votes
1 answer

knitr with gganimate, cannot find ffmpeg command

I am trying to produce an animated plot with gganimate following instructions from the knitr documentation: knitr::opts_chunk$set(message = FALSE, warning = FALSE, fig.show = "animate") # Example from…
Alex
  • 15,186
  • 15
  • 73
  • 127
2
votes
2 answers

gganimate unable to call ImageMagick correctly, possible path error

I am trying to install gganimate in Windows 7. I have already added Path to ImageMagick and below are the codes I used in my attempt to install it. library(httr) set_config(config(ssl_verifypeer =…
1
vote
1 answer

How to animate geom_text and shaded annotate in gganimate chart

I have the following dataframe in R data <- structure(list(Date = structure(c(19541, 19542, 19543, 19544, 19545, 19548, 19549, 19550, 19551, 19552, 19555, 19556, 19557, 19558, 19559, 19562), class = "Date"), Value = c(18.7414, 18.6471, 18.7749,…
Tanga94
  • 695
  • 6
  • 27
1
vote
2 answers

Display calculated value per facet per frame using gganimate

I am trying to summarize the Pearson correlation index between x and y per facet (grouping) z and per frame by transition_filter data.frame(x = runif(300), y = runif(300), z = runif(300), g = rep(c("a", "b", "c"), each = 100)) %>% ggplot(aes(x =…
Tianjian Qin
  • 525
  • 4
  • 14
1
vote
0 answers

Animating map fill color through time

I am trying to animate a map of Texas over time, such that the fill color changes depending on if an event happened. However, I keep getting the following error message: Error: arguments have different crs. I suspect the error is related to the fill…
tassones
  • 891
  • 5
  • 18
1
vote
0 answers

Why is the ggplot not generating any plot?

I wanted to plot a animated plot using gganimate , here is the code: library(ggplot2) library(dplyr) library(reshape2) library(gganimate) rain<-read.csv("csvrainfall.csv") temp<- read.csv("temp.csv") mean_temp<-temp$Temp > #computing mean annual…
1
vote
0 answers

Using gganimate, ggplot and a waffle chart

Code below produces a waffle chart of a packet of skittles. I want to simulate a packet of skittles being eaten, with each skittle being chosen at random. Therefore I want to create an animated plot using gganimate of the number of circles reducing…
luciano
  • 13,158
  • 36
  • 90
  • 130
1
vote
1 answer

Error: arguments have different crs in gganimate

I am trying to plot a map using gganimate, however, I keep getting Error: arguments have different crs. This is my code: library(tidyverse) library(sf) library(rnaturalearth) library(countrycode) library(gganimate) library(transformr) world <-…
Honorato
  • 111
  • 6
1
vote
1 answer

Use gganimate to successively draw lines and then fade

I'm trying to work on an animation for an upcoming presentation but have hit a bit of a wall. What I'm trying to do is have gganimate draw lines for several species, one after the other, and once a line has finished being drawn have it either fade…
Josh
  • 49
  • 5
1
vote
0 answers

Separate the elements of the first frame from the last frame

I want to create a GIF that plots the countries in Africa one by one. However, I noticed that the appearance of the border for the first country always appears in the last frame instead of the first. This issue becomes more noticeable when adding an…
1
vote
1 answer

Fix plot position in a Gif - animate plot with dynamic axis labels

I am trying to make a gif(for each frame I want to plot the variable in the y axis, and the value in x axis), but bit struggled to fix the plot position since it will move once the length of the variable in y axis changes. Here is one reproducible…
1
vote
0 answers

How do I keep the labels displayed at the end of the animation?

The problem with this code is that, as you will see, the last frame of the animation does not display all of the time series labels. I expect all of the labels to be present throughout, but only the "Zinc" label is present in the last…
OCR
  • 11
  • 1
1
vote
1 answer

How to animate a bar plot in R that represents one variable increasing over time, synchronised with a second animation?

I would like to create an animated bar plot that increases at specified times, synchronized with another plot (links to both gifs at bottom). Whenever the ball hits the right side wall I'd like it to display as a synchronized increase in the bar…
Zinn
  • 125
  • 5
1
vote
1 answer

gganimate does not stop at the defined value

Update: Sorry I forgot to add the vector: time=1:100 value = 1:67 fill = rep(max(value), 100-max(value)) I want to make an animated stacked bar, Here is my example: library(tidyverse) library(gganimate) #example data frame df <- tibble(time =…
TarJae
  • 72,363
  • 6
  • 19
  • 66