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

How to get rid of axis flickering caused by coord_flip when using gganimate and view_follow and geom_tile?

Let's say we have this bar chart race with a scaling x-axis. Taking the code exactly from this answer by @Jon Spring and adding the very final line (before the animate…
bill999
  • 2,147
  • 8
  • 51
  • 103
6
votes
1 answer

ggplot2 error message: Error in seq.default(range[1], range[2], length.out = nframes) : 'from' must be a finite number

I am trying to make an animated bubble plot of the following data: Country/Region 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 …
user12696197
  • 63
  • 1
  • 1
  • 6
6
votes
1 answer

How to have x-axis span move with gganimate animation?

Using R, I am trying to make a line graph which is revealed left to right based on x-axis using gganimate. I have managed to do this but what I also wanted to do was make it so that the scale_x_continuous(limits = c(i-5,i+5)), i.e. there is a window…
user3456588
  • 609
  • 4
  • 9
6
votes
1 answer

Animate ggplot time series plot with a sliding window

I'm looking for ways to animate a long time series plot without losing resolution. I would like the view to "pan" across the data, showing a sliding subset of it from the beginning to the end. Suppose I have the following: library(ggplot2) …
Thomas Speidel
  • 1,369
  • 1
  • 14
  • 26
6
votes
1 answer

Animated barplot via gganimate: conflict of view_follow & coord_flip

I want to crate an animated barchart with the gganim package. The coordinates of the barchart should be flipped via coord_flip (i.e. horizontal bars) and the x-axis should be made flexible depending on the length of the bars via…
Joachim Schork
  • 2,025
  • 3
  • 25
  • 48
6
votes
1 answer

gganimate round values during transition

I want to create an animated barplot with the gganimate package. At the top of each bar, I want to put the value of the bar rounded to zero digits. Consider the following example: # Example data df <- data.frame(ordering = c(rep(1:3, 2), 3:1,…
Joachim Schork
  • 2,025
  • 3
  • 25
  • 48
6
votes
1 answer

Multiple gganimate plots side by side

I would like to display animations made by the package gganimate side by side or at least in the same document. Plots to work with: library(ggplot2) library(gganimate) anime_one <- ggplot(mtcars, aes(factor(cyl), mpg)) + geom_boxplot() + #…
Steen Harsted
  • 1,802
  • 2
  • 21
  • 34
6
votes
2 answers

GGanimate: geom_text with numeric values animates at decimal numbers instead of integers

Data <- data.frame(Time = c(1, 1, 1, 2, 2, 2, 3, 3, 3), Group = c("A", "B", "C", "A", "B", "C", "A", "B", "C"), Value = c(20, 10, 15, 20, 20, 20, 30, 25, 35)) I have three Groups with Values at three different…
Nautica
  • 2,004
  • 1
  • 12
  • 35
6
votes
2 answers

Keep points in gganimate

I would like to document the progress in a test situation using gganimate: I have come so far: library(tidyverse) library(gganimate) data <- tribble(~user, ~agree, ~accord, ~messung, "1", .8, .9, 1, "2",.7, .8, 1, …
6
votes
1 answer

Using ggplot to plot shapefile and gganimate for animation

Sample data library(raster) library(ggplot2) my.shp <- getData('GADM', country = 'FRA', level = 1) plot(my.shp) If I want to plot this data using ggplot: my.shp_f <- fortify(my.shp, region = "ID_1") ggplot(data = my.shp_f, aes(long, lat, group =…
89_Simple
  • 3,393
  • 3
  • 39
  • 94
6
votes
2 answers

How to save frames of gif created using gganimate package

I will use the gapminder data as an example. Let's say I create this animation: library(gapminder) library(ggplot2) theme_set(theme_bw()) p <- ggplot(gapminder, aes(gdpPercap, lifeExp, size = pop, color = continent, frame = year)) + geom_point()…
Andrew Bade
  • 333
  • 3
  • 10
6
votes
1 answer

Plot titles when using gganimate with tweenr

I am trying to add a year title to plot from a data set that has been run through tweenr. Following the example from revolutionanalytics.com library(tidyverse) library(tweenr) library(gapminder) gapminder_edit <- gapminder %>% arrange(country,…
guyabel
  • 8,014
  • 6
  • 57
  • 86
6
votes
3 answers

Animate the process of adding layers to a ggplot2 plot

I am starting to get familiar with gganimate, but I want to extend my gifs further. For instance, I can throw a frame on one variable in gganimate but what if I want to animate the process of adding entirely new layers/geoms/variables? Here's a…
emehex
  • 9,874
  • 10
  • 54
  • 100
5
votes
1 answer

How to animate a ternary plot in R

I am trying to animate a ternary plot in R with gganimate and I am facing into a wall. library(tidyverse) library(gganimate) library(ggtern) #> Registered S3 methods overwritten by 'ggtern': #> method from #> grid.draw.ggplot…
LDT
  • 2,856
  • 2
  • 15
  • 32
5
votes
2 answers

How to use multiple cores to make gganimate faster

My question is how can I utilize multiple cores of my iMac in order to make gganimate go faster. There is another question (and more linked to below) that asks this same thing—my question is about an answer to this question: Speed Up gganimate…
bill999
  • 2,147
  • 8
  • 51
  • 103
1 2
3
36 37