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

R Animating line plot using gganimate and geom_text

I made animated plot using gganimate, so I can see the change in y axis as the year goes by. So far, I have the setting below and it does most of the stuff I'm trying to achieve. However, I definitely want to clean up the geom_text portion a little…
3
votes
0 answers

R Shiny plot by time

I have data with a row corresponding to an event (Receipts, Made Tackle or Ball carry) at a given time (GameSeconds). I would like to have a dynamic graph adding each event according to their time. The solution I am trying is to put the graph in a…
Jeremy
  • 33
  • 3
3
votes
1 answer

transition_time with shadow mark for only one geom / layer

I believe the images below should be fairly self explanatory. When using transition_time, does anyone have an idea how to create a shadow mark for only one geom (for labelling)? Any workarounds very welcome. In a normal world, I'd create two plots…
tjebo
  • 21,977
  • 7
  • 58
  • 94
3
votes
1 answer

Is there a way to save a gganimate object as a HTML page with animation control buttons?

Goal To control the animation using start/stop/pause buttons. Problem The animation package can save the created animation as a HTML page using the saveHTML() function (example here). But it requires "expr = an R expression to be evaluated to create…
umair durrani
  • 5,597
  • 8
  • 45
  • 85
3
votes
1 answer

Is there a way to make geoms fade but persist in gganimate?

I have geographic data like the following (but a much larger amount of data): library(tidyverse) library(gganimate) n <- 500 longitude <- runif(n) latitude <- runif(n) time <- round(runif(n, 0, 100),1) %>% sort data <- tibble(longitude,latitude)…
Jacques P.
  • 31
  • 2
3
votes
1 answer

How to make geom_text on the left of y-axis

I am trying to do an animation to show the top 10 country in terms of GDP per captia. I am able to make the gif as below. I would like to make the label of country on the left side of y-axis. How can I do that? Here is my…
Liang Xu
  • 51
  • 2
3
votes
1 answer

Ghost geom_text in gganimate

I am playing around with gganimate and I do believe it is acting slightly funky when it comes to labels (I've basically followed this example). I am generating the following .gif with this code snippet (you can find the data here, didn't want post…
anddt
  • 1,589
  • 1
  • 9
  • 26
3
votes
1 answer

How can I make an animation in R showing a histogram with different bin sizes?

I wanted to use gganimate() but couldn't find a workable solution. I ended up successfully creating something - using the animation package. I was able to create both a GIF and a Video output - but neither was as smooth or as good as I was…
3
votes
1 answer

gganimate does not smooth animation

I have been trying to figure out this for days, but I cannot understand what I am missing. gganimate does not seem to add any transition between frames. I am using the Tour de France dataset from the tidytuesday. From this, I made a dataframe with…
Andrea
  • 529
  • 5
  • 10
3
votes
1 answer

Wiggling lines when animating ggplot choropleth with gganimate

I have a problem when using gganimate to animate a choropleth map made with ggplot2. A selection of my data is available here and the code is: library(tidyverse) library(gganimate) part_data <- readRDS(file = "part_data.Rds") p <- part_data %>% …
avs
  • 617
  • 5
  • 13
3
votes
0 answers

Make R Store Memory in HDD/SDD instead of RAM?

I am running code in gganimate to create an animation using a large amount of data. I have 32GB RAM but it just isn't quite enough, I get the error 'Cannot allocate vector size XXX'. I can get it to run if I make the data smaller (using moving…
user3456588
  • 609
  • 4
  • 9
3
votes
1 answer

Using gganimate with geom_point and geom_line

working with nfl data here.. trying gganimate for the first time... trying to use geom_point and geom_line but geom_line will not appear.. data frame here.. week = c(1,2,3,4,5,6,8,9,10,11,12,13,14,15,16,17) plays=…
3
votes
1 answer

How to render ggplot2+gganimate+ggflags faster

I am making plots using ggplot2+gganimate+ggflags, but it renders very slow: typically at or less than 0.1 frames per second. So if I have, say, 300 frames, it takes a very long time. I have noticed that it is ggflags that causes it to become much…
bill999
  • 2,147
  • 8
  • 51
  • 103
3
votes
1 answer

Use transition_reveal in gganimate to cumulatively plot lines

Is there a way to use transition_reveal() in gganimate to draw lines one by one - or a workaround using other transition functions.. library(tidyverse) library(gganimate) set.seed(1) d <- tibble(x = 1:100, a = cumsum(rnorm(100)), b =…
guyabel
  • 8,014
  • 6
  • 57
  • 86
3
votes
1 answer

How to animate grouped barplots with gganimate?

I would like to animate a grouped barplot, such that each series is plotted in turn and then remains visible. In the example plot below I would like the bars with id = 1 to be plotted first and remain while id = 2, id = 3, id = 4 are plotted in…
grdn
  • 93
  • 4