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

Which transition_* to use for animating map with gganimate?

I want to make a animated choropleth map of US counties with the number of confirmed COVID-19 cases over time (yes, yet another coronavirus plot). Here is a link to a three day selection of the data (suggestions for a more permanent place to host it…
avs
  • 617
  • 5
  • 13
5
votes
1 answer

Strange behavior of ggplot's geom_polygon when using gganimate

Say that I have these data. One for shading counties of a state and the other for plotting points. library(tidyverse) library(gganimate) devtools::install_github("UrbanInstitute/urbnmapr") library(urbanmapr) #1. counties dataset for the shading of…
bill999
  • 2,147
  • 8
  • 51
  • 103
5
votes
1 answer

Using gganimate with waffle charts

I've been playing with the waffle package, and am trying to get it to work with gganimate. Using mpg as an example, I've created waffle charts to show number of models by each class. I would then like to use gganimate to display, in turn, a chart of…
jllls
  • 83
  • 4
5
votes
1 answer

Building a stacked histogram with gganimate

I'm trying to show a histogram building over time. It would start with, say, 1952 data, then each year update the histogram, growing. The path seems to be gganimate, and I would think using transition_reveal to slowly reveal more data over time.…
Frank
  • 51
  • 2
5
votes
2 answers

Animated sorted bar chart: problem with overlapping bars

I created an animated bar chart which displays the scored goals by some players. Below the whole code is displayed how I came to the output. The animation works as wished. However, bars with the same value overlap. I would like to prevent the bars…
Albin
  • 822
  • 1
  • 7
  • 25
5
votes
1 answer

How to rotate a custom annotation in ggplot?

I would like to rotate an image included in annotation_custom in ggplot2. For an animation with gganimate, I would like to add images with specific angles to a line plot. Unfortunately, there is no angle parameter in…
Sma
  • 65
  • 4
5
votes
1 answer

gganimate barchart: smooth transition when bar is replaced

I want to create an animated barplot with the gganimate package. The barplot should contain 4 bars, but only three of the bars should be shown at the same time. When a bar drops out and a new bar comes in, the animation should be smooth (as it is…
Joachim Schork
  • 2,025
  • 3
  • 25
  • 48
5
votes
0 answers

r gganimate: transition_reveal (changing title)

I'd like to create a transition_reveal animation using gganimate whereby the title changes along the currently revealed iteration. So, the title at the start would be "Date: 2019-01-01" and then gradually adapt alongside the animation and finish by…
wind_2801
  • 131
  • 10
5
votes
1 answer

How to make a shadow_mark without interpolating points?

How can I create an animation that 1. adds new points to the plot at a time proportional to the measurement time, and 2. fades out older points over time? I thought maybe I could achieve this with the following…
wdkrnls
  • 4,548
  • 7
  • 36
  • 64
5
votes
1 answer

time-series in ggplot using geom_line

I'm relatively new to gganimate and I'm trying to create a simple polynomial time-series graph on R studio. x <- 1:100 f <- function (x){ return(-(x)^2) } df <- data.frame(x, y= -(x)^2) ggplot(df, aes(x, y)) + geom_line() + …
flustercludge
  • 77
  • 1
  • 7
5
votes
1 answer

gganimate renders pixelated in windows 10

I must render some animations using gganimate but the images are not good looking. They lack definition and borders are pixelated. Is there any way of getting better results in windows 10? My code is:…
Forge
  • 1,587
  • 1
  • 15
  • 36
4
votes
1 answer

Not getting the desired title in gganimate - animated labels with expression

I want to add a unit of m^2 m^-2 (but as an expression) next to a variable using gganimate. For example the following gives me my desired output when I do it using only ggplot2: library(ggplot2) ggplot(mtcars, aes(wt, mpg)) + geom_point()…
bird
  • 2,938
  • 1
  • 6
  • 27
4
votes
1 answer

Issue with label behavior in gganimate plot

I have the following R script which produces a static chart library(ggplot2) library(dplyr) library(tidyr) library(stringr) …
jerH
  • 1,085
  • 1
  • 12
  • 30
4
votes
1 answer

How to create animation in html output using R Markdown

Here is the list of things I've tried. --- title: "test_gif" output: html_document --- ``` {r, animation.hook='gifski', dev='png', interval=0.2} library(gganimate) ggplot(airquality, aes(Day, Temp, group = Month)) + geom_line() + …
4
votes
1 answer

geom_path fade out in gganimate

I'm working with spatial data. I'd like to create an animation of a movement path, with older data fading out. I figured out how to create the fade-out effect with points, but it looks like there's no built-in support for transitions for geom_path…
user2602640
  • 640
  • 6
  • 21