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

Animated sorted bar chart with bars overtaking each other

Edit: keyword is 'bar chart race' How would you go at reproducing this chart from Jaime Albella in R ? See the animation on visualcapitalist.com or on twitter (giving several references in case one breaks). I'm tagging this as ggplot2 and gganimate…
moodymudskipper
  • 46,417
  • 11
  • 121
  • 167
33
votes
2 answers

Speed Up gganimate Rendering

I am currently creating a gif which contains large data. I want it in high resolution. On my old PC it took hours to render and simply wasn't worth it. My new PC has a very strong intel i9-9900k core processor which has sped it up to about 30…
user3456588
  • 609
  • 4
  • 9
27
votes
1 answer

Control speed of a gganimation

I want to slow the transition speed between states when using library(gganimate). Here is a mini example: # devtools::install_github("thomasp85/gganimate") library(gganimate) # v0.9.9.9999 dat_sim <- function(t_state, d_state) { data.frame( x…
Nate
  • 10,361
  • 3
  • 33
  • 40
27
votes
4 answers

Define size for .gif created by gganimate - change dimension / resolution

I'm using gganimate to create some .gif files that I want to insert into my reports. I'm able to save the files and view them fine, however, I find that the displayed size is small: 480x480. Is there a way to adjust that - perhaps along the lines of…
Gautam
  • 2,597
  • 1
  • 28
  • 51
23
votes
1 answer

Animated plot with a moving facet zoom via gganimate and ggforce?

Goal I would like to zoom in on the GDP of Europe throughout the years. The phantastic ggforce::facet_zoom allows this for static plots (i.e., for one specific year) very easily. Moving scales, however, prove harder than expected. gganimate seems…
Roman
  • 4,744
  • 2
  • 16
  • 58
22
votes
3 answers

Animated dot histogram, built observation by observation (using gganimate in R)

I would like to sample points from a normal distribution, and then build up a dotplot one by one using the gganimate package until the final frame shows the full dotplot. A solution that works for larger datasets ~5,000 - 20,000 points is…
max
  • 4,141
  • 5
  • 26
  • 55
22
votes
2 answers

Using gganimate to export gif

The package gganimate creates gifs (MWE code from here): library(ggplot2) #devtools::install_github('thomasp85/gganimate') library(gganimate) p <- ggplot(mtcars, aes(factor(cyl), mpg)) + geom_boxplot() + #…
Flo
  • 1,503
  • 1
  • 18
  • 35
20
votes
2 answers

Any way to pause at specific frames/time points with transition_reveal in gganimate?

Utilising this example from the package's wiki on Github: airq <- airquality airq$Month <- format(ISOdate(2004,1:12,1),"%B")[airq$Month] ggplot(airq, aes(Day, Temp, group = Month)) + geom_line() + geom_segment(aes(xend = 31, yend = Temp),…
Nautica
  • 2,004
  • 1
  • 12
  • 35
20
votes
1 answer

Change label of gganimate frame title

Skimming through the options of gganimate that can be set when gg_animate() is called to render the animated sequence, it seems that there is no option to change the frame title so to make it clearer to the observer of what is the parameter that the…
Nicola Pasquino
  • 441
  • 1
  • 3
  • 11
19
votes
3 answers

Pause between gganimate loops

Is it possible to add a pause between gganimate loops? I know we can set the interval between frames with interval, but is there a way to pause on the final frame before looping back to the first frame? Is the best method to insert multiple copies…
willk
  • 3,727
  • 2
  • 27
  • 44
14
votes
1 answer

gganimate plot where points stay and line fades

Here is a reproducible example of a static plot, which I want to animate (I want to show how a MCMC sampler behaves). library(tidyverse) library(gganimate) set.seed(1234) plot_data <- tibble(x=cumsum(rnorm(100)), …
Björn
  • 644
  • 10
  • 23
13
votes
3 answers

How to render a gganimate graph in html using rmarkdown::render(), without generating unwanted output

I am trying to render gganimate() plots in html using an r-markdown document. I am able to create the html document (though the simple example below takes at least a minute) and the gganimate graphic successfully loads in the browser (firefox),…
axme100
  • 377
  • 5
  • 13
12
votes
1 answer

gganimate plot not showing and saving bunch of .png's

I am trying to replicate a simple example about gganimate from here. The problem is simple ggplot part works fine but when I add transition_states rstudio starts rendering and then saves bunch of gganim_plotXXXX.png files and doesn't show the…
Onur Guven
  • 620
  • 4
  • 15
12
votes
1 answer

gganimate returns .png files, but no animated object

I am trying to create an animation to show students how to represent data with animations. Running the below code library(ggplot) library(gganimate) library(carData) anim <- ggplot(mtcars, aes(mpg, disp)) + …
Rosario
  • 183
  • 1
  • 11
12
votes
3 answers

gganimate: include additional variable other than states level variable or frame in title expression

I'd like to insert another column value of my data into a gganimate animation title. Example, here the states level variable is x and I'd like to add to title variable y: df <- tibble(x = 1:10, y = c('a', 'a', 'b', 'd', 'c', letters[1:5])) df A…
Giora Simchoni
  • 3,487
  • 3
  • 34
  • 72
1
2 3
36 37