gganimate extends the grammar of graphics as implemented by ggplot2 to include the description of animation. It does this by providing a range of new grammar classes that can be added to the plot object in order to customize how it should change with time. Here we take a simple boxplot of fuel consumption as a function of cylinders and let it transition between the number of gears available in the cars. As this is a discrete split (gear being best described as an ordered factor) we use transition_states and provide a relative length to use for transition and state view. As not all combinations of data are present there are states missing a box. We define that when a box appears it should fade into view, whereas it should shrink away when it disappears. Lastly, we decide to use a sinusoidal easing for all our aesthetics (here, only y is changing) gganimate is available on CRAN and can be installed with install.packages('gganimate').

Features

  • gganimate mimics the way ggplot2 renders its output
  • Under the hood, the animate() function is called which renders the frame and passes the frames to a renderer functions
  • gif is a fantastic format for animations due to its wide support
  • Further there’s support for rendering to sprite sheets if that is your vice
  • Video output are automatically embedded in RMarkdown documents
  • This is the second iteration of the gganimate package

Project Samples

Project Activity

See All Activity >

Follow gganimate

gganimate Web Site

You Might Also Like
Gen AI apps are built with MongoDB Atlas Icon
Gen AI apps are built with MongoDB Atlas

The database for AI-powered applications.

MongoDB Atlas is the developer-friendly database used to build, scale, and run gen AI and LLM-powered apps—without needing a separate vector database. Atlas offers built-in vector search, global availability across 115+ regions, and flexible document modeling. Start building AI apps faster, all in one place.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of gganimate!

Additional Project Details

Programming Language

R

Related Categories

R Graphics Software, R Data Visualization Software

Registered

2022-07-13