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

How to keep previous layers of data while doing animation in R gganimate?

I'm doing animation using ggplot and gganimate. In the previous version of gganimate there was an option "cumulative", seem that new version does not support this. Here's the code: library(ggplot2) library(gganimate) x = data.frame(y = c(2000,…
Petr
  • 105
  • 10
3
votes
1 answer

latest gganimate: How to have a fixed plot in the background?

In the latest version of gganimate by https://github.com/thomasp85 I would like to choose which parts of the plot I can keep static throughout the animation and which will be animated. In the previous version of gganimate you could specify the frame…
Fatm
  • 67
  • 7
3
votes
1 answer

gganimate: handling of missing values

I'm trying the gganimate package for the first time and run into a problem with the handling of missing values (NA). I apologize if my question is trivial but I couldn't find any solution. Here is a reproducible example of what I'm trying to do: #…
Pascal Martin
  • 311
  • 2
  • 9
3
votes
1 answer

How to use multiple columns as the frame of an animation in gganimate package (R)?

I am trying to use gganimate package of R, to create an animation of a bunch of histograms, where each frame of the animation shows a histogram of an image. I have ~400 images, so ~400 columns. My data looks like this: | bins.left | bins.right |…
Azim
  • 1,596
  • 18
  • 34
3
votes
1 answer

gganimate creating duplicate images

I've got a data frame that looks like the below: head(newnolarank) lon lat week b 1 -90.06445 29.97121 1 9 2 -90.06704 29.96944 1 9 3 -90.07495 29.96567 1 9 4 -90.07448 29.96621 1 9 5 -90.16480 29.91240 1 9 6 -90.04797…
ike
  • 342
  • 3
  • 17
3
votes
4 answers

problems creating plot animations with gganimate in R

I am trying to create animation using gganimate To make the animation I wanted, I followed this tutorial: https://github.com/dgrtwo/gganimate which does basically what I want. data can be found below here is the code for my plot…
Julien
  • 992
  • 1
  • 10
  • 26
3
votes
1 answer

geom_contour fails in gganimate but works in ggplot2

I have a problem I cannot solve. I am trying to create an animation using gganimate with geom_contour. When I plot the data frame as a single "frame" it works with no problems; however when I add the "frame" aesthetic and try to run it with…
slwu89
  • 33
  • 1
  • 4
2
votes
1 answer

Problem animating with geom_sf and gganimate: Error: arguments have different crs

I am trying to animate a plot of changing counts of something in each region of the UK over the course of 10 years. I have an shapefile of UK regions which can be downloaded from this URL and loaded using: uk_map <- read_sf(filepath) I have a…
2
votes
0 answers

Points disappear in final frame of gganimate chart

I am developing a gganimate animation that shows the data points over time between two metrics, x and y, with a line chart trailing behind them showing 'where you've been'. Something along the lines of…
Margaret
  • 5,749
  • 20
  • 56
  • 72
2
votes
1 answer

How do I make a line chart and showing title with Date using gganimate?

I have this dataset: str(combined_data) Output: tibble [48 × 3] (S3: tbl_df/tbl/data.frame) $ hour : chr [1:48] "2022/02/08 00:00:00" "2022/02/08 01:00:00" "2022/02/08 02:00:00" "2022/02/08 03:00:00" ... $ total_identy: num [1:48] 660512…
datasever
  • 37
  • 4
2
votes
0 answers

How to animate multiple R points per date in gganimate

I am working on animating the path of boats through the Pacific. I have a data set with ship ID, lat, lon, and dates. I have successfully been able to plot the points on a map and animate the points. Once I animate the points, it appears to skip…
mcdejer
  • 41
  • 2
2
votes
1 answer

gganimate and plotly do not render on rmarkdown with shiny app

A rmarkdown does not render plots made with gganinate and plotly. The app should have a select input box to choose each plot.I saw that renderImage() and renderPlotly() should be used. How will I incorporate these functions? What is the better way…
2
votes
1 answer

Animated Kaplan Meier plot, how to expand plot area in x axis direction

I have this survival dataframe: df <- structure(list(time = c(5, 6, 8, 10, 11, 12, 13, 14, 15, 17, 18, 20, 22, 27, 31, 32, 34, 39, 43, 44, 47, 48, 50, 60, 69, 77, 120, 1, 4, 6, 7, 8, 9, 11, 12, 13, 14, 15, 17, 19, 22, 23, 25, 26, 27, 31, 38,…
TarJae
  • 72,363
  • 6
  • 19
  • 66
2
votes
1 answer

How to animate points being added to a plot in a certain amount of time?

I have a df containing 10000 data points that I want to add to a plot one by one using gganimate. So the data is: df = data.frame(x = runif(10000), y = runif(10000), z = 1:10000) # z column is needed for…
bird
  • 2,938
  • 1
  • 6
  • 27
2
votes
1 answer

Accelerating transitions in gganimate

I have a plot with several hundred lines. I would like these lines to appear over time; first slowly, to have the time to explain what's going on to the audience; then faster and faster. The minimal example below gives an example of how the…
Christoph_J
  • 6,804
  • 8
  • 44
  • 58