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

gganimate::shadow_mark(): exlude all layers but 1st one

I want to use shadow_mark() to leave just the 1st set of raw data remaining on the plot to show the initial conditions. I do: require(ggplot2) require(gganimate) table(airquality$Month) ggplot(airquality, aes(Day, Temp)) + geom_line(aes(color =…
user2955884
  • 405
  • 2
  • 11
1
vote
1 answer

Why do I get a blank animation instead of a map and two geom_points on top?

I tried to produce a gganimation with two geoms on a map of germany, but eventually only produced a blank animation. This here is a reproducible example of the animation I tried to produce: # Load necessary packages pacman::p_load(ggplot2,…
1
vote
1 answer

Animate R specific geoms in ggplot/gganimate

I have a dataset where I want to create an animated plot. This plot is going to show progression of the x and y values over time. I can get that working just fine, where this produces a plot with a moving…
rg255
  • 4,119
  • 3
  • 22
  • 40
1
vote
2 answers

gganimate lots of stacked geom_col producing white spaces in the animation

I am building an animation of stacked bar charts (calling geom_col). I have 100 columns. When I generate the animation I get a lot of white space in what should be filled columns. See the gif below: That gif is based on about 100k rows of data, so…
MorrisseyJ
  • 1,191
  • 12
  • 19
1
vote
0 answers

gganimate invalid times argument

I am trying to make a convergence plot, but I am getting the error Error in rep(seq_len(nrow(polygon)), splits + 1) : invalid 'times' argument How do I get around this…
Alex
  • 2,603
  • 4
  • 40
  • 73
1
vote
0 answers

Animated dotplot (using gganimate in R)

I have a data frame of countries and some events in each country. How to animate a dotplot of events for each country through time df <- data.frame(country = factor(c("Mexico", "USA","France", "USA","France","Mexico", "USA")), …
1
vote
1 answer

How to make animation of items for a specific subject's responses over time?

Data Here is the simulated data for my question. It consists of subjects, items (stimuli), and a T/F response to each item: #### Load Tidyverse #### library(tidyverse) library(gganimate) #### Create Tibble #### set.seed(123) subject <-…
Shawn Hemelstrand
  • 2,676
  • 4
  • 17
  • 30
1
vote
0 answers

How can fixe the probel of saving gganime file that is related to using the old API?

My code is following: p <- ggplot() + geom_sf(data = world, size = .1) + geom_sf(aes(fill = SupDem), data = plotdata) + scale_fill_viridis_c(option = "plasma") + ggtitle("Democratic Support - {closest_state}") + …
user19562955
  • 293
  • 1
  • 9
1
vote
0 answers

gganimate tween values showing hexadecimal values

Based on this SO question I am trying to create an animated bar plot, but the bar label tween values are showing hexadecimal values: library(ggplot2) library(dplyr) library(gganimate) set.seed(123) df <- data.frame( period = rep(1:3, each = 5), …
LMc
  • 12,577
  • 3
  • 31
  • 43
1
vote
1 answer

Space between labels and line in gganimate

I have tried to create an animated graph for which I am using geom_smooth that moves and also the labels that move with the lines. However, I am not able to provide space between the line and labels so their legibility is affected. Need to solve…
ambrish dhaka
  • 689
  • 7
  • 27
1
vote
0 answers

Can I control when animation appears on gganimate by a click?

I want to make my animations for a powerpoint that I am presenting and so am using gganimate for my data. However, I would like the next set of data to only cycle in when I click as I will be speaking over the data, is this possible? (in…
Banterny
  • 25
  • 4
1
vote
0 answers

Animate Probability Density Function with gganimate

I am trying to replicate the beta distribution animation of Wikipedia in R. Originally, I started with the following code ggplot() + xlim(0, 1) + geom_function(fun = dbeta, args = list(shape1 = 5, shape2 = 5)) But I did not manage to use…
retodomax
  • 434
  • 3
  • 14
1
vote
1 answer

Is there a way to display a GIF image in Colab R Kernel?

I have created a gif made of choropleths in Colab using the R Kernel. The code is: GIF <- mapa_provincias %>% ggplot() + #Iniciamos ggplot2 sin añadir nada geom_sf(aes(fill = Tasa_Paro/100), color= "black", size = 0.2) + #fill: variable que…
AlejandroDGR
  • 178
  • 1
  • 10
1
vote
1 answer

have paths fade away in gganimate

I am trying to plot multiple paths in a gganimate plot. I want the lines to fade out over the last N frames (e.g. N=5 in this example). The data look like this: set.seed(27) df <- data.frame(Frame = rep(1:10, 3), id =…
jalapic
  • 13,792
  • 8
  • 57
  • 87
1
vote
1 answer

How to connect user input with gganimate graph in R shiny?

Is there a way to link user input (x-axis, y-axis, colour etc) to the gganimate graph in R shiny? So that when the user selects a different input (x-axis, y-axis, colour, etc.) from the drop-down list. gganimate graph will be filled with different…
user13971133