Skip to content
Back to skills

Gganimate

ASecurity

R gganimate package for animated ggplot2 plots. Use for creating animated visualizations with transitions.

  • 5 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added June 4, 2026
datago

Security analysis

A100/100

Scanned June 4, 2026

npx -y skills add LeoLin990405/r-analytics-skill --skill gganimate --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Gganimate?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Gganimate
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/leolin990405-gganimate/badge)](https://www.skillsdirectory.com/skills/leolin990405-gganimate)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: gganimate
description: R gganimate package for animated ggplot2 plots. Use for creating animated visualizations with transitions.
---

# gganimate

Animate ggplot2 plots.

## Basic Animation

```r
library(gganimate)

p <- ggplot(df, aes(x, y)) +
  geom_point() +
  transition_time(year) +
  labs(title = "Year: {frame_time}")

animate(p)
```

## Transitions

```r
# Time-based
transition_time(time_var)
transition_time(year) + labs(title = "Year: {frame_time}")

# State-based
transition_states(state_var, transition_length = 2, state_length = 1)
transition_states(category) + labs(title = "{closest_state}")

# Reveal
transition_reveal(along = time_var)

# Filter
transition_filter(transition_length = 2, filter_length = 1,
  condition1, condition2, condition3)

# Layers
transition_layers(layer_length = 1, transition_length = 2)

# Manual
transition_manual(frame_var)
```

## Enter/Exit

```r
# Enter animations
enter_fade()
enter_grow()
enter_appear()
enter_fly(x_loc = 0, y_loc = 0)
enter_drift(x_mod = 0, y_mod = 1)

# Exit animations
exit_fade()
exit_shrink()
exit_disappear()
exit_fly(x_loc = 0, y_loc = 0)
exit_drift(x_mod = 0, y_mod = -1)

# Combined
p + transition_states(state) +
  enter_fade() + enter_grow() +
  exit_fade() + exit_shrink()
```

## Easing

```r
# Easing functions
ease_aes("linear")
ease_aes("quadratic-in")
ease_aes("quadratic-out")
ease_aes("quadratic-in-out")
ease_aes("cubic-in-out")
ease_aes("elastic-in-out")
ease_aes("bounce-in-out")

# Per aesthetic
ease_aes(x = "cubic-in-out", y = "bounce-out")
```

## Shadow

```r
# Keep previous frames
shadow_wake(wake_length = 0.1)
shadow_trail(distance = 0.05, size = 0.3)
shadow_mark(past = TRUE, future = FALSE)
shadow_null()  # No shadow
```

## View

```r
# Follow data
view_follow()
view_follow(fixed_x = TRUE)
view_follow(fixed_y = c(0, NA))

# Step through views
view_step(pause_length = 2, step_length = 1, nsteps = 3)

# Static view
view_static()
```

## Rendering

```r
# Animate
anim <- animate(p, nframes = 100, fps = 10)

# Options
animate(p,
  nframes = 200,
  fps = 20,
  width = 800,
  height = 600,
  res = 150,
  renderer = gifski_renderer()
)

# Renderers
gifski_renderer()  # GIF (default)
magick_renderer()  # GIF via magick
av_renderer()      # Video
ffmpeg_renderer()  # Video via ffmpeg
file_renderer()    # PNG sequence

# Save
anim_save("animation.gif", anim)
anim_save("animation.mp4", anim, renderer = av_renderer())
```

## Labels

```r
# Dynamic labels
labs(title = "Year: {frame_time}")
labs(title = "State: {closest_state}")
labs(title = "Frame {frame} of {nframes}")
labs(subtitle = "{frame_time}")
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.