Skip to content

Commit

Permalink
fix(gganimate.Rmd): Use 'anim_save()'
Browse files Browse the repository at this point in the history
* In `gganimate.Rmd` we now save {gganimate} animation
  with `gganimate::anim_save()` instead of trying
  to save and view animation with {knitr} hook.
* This avoids an error due to an upstream bug.

closes #108
  • Loading branch information
trevorld committed Apr 19, 2024
1 parent e0fd453 commit 91ec6f4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: ggpattern
Type: Package
Title: 'ggplot2' Pattern Geoms
Version: 1.1.0-6
Version: 1.1.0-7
Authors@R: c(person("Mike", "FC", role = "aut"),
person("Trevor L.", "Davis", role = c("aut", "cre"),
email = "trevor.l.davis@gmail.com",
Expand Down
1 change: 1 addition & 0 deletions vignettes/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.html
*.R
images/*.gif
10 changes: 3 additions & 7 deletions vignettes/gganimate.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ knitr::opts_chunk$set(
fig.width = 6,
fig.height = 4
)
require("gganimate", quietly = TRUE)
```


Expand Down Expand Up @@ -58,13 +59,8 @@ p <- ggplot(df, aes(trt, outcome)) +
p <- p + transition_states(time, transition_length = 2,
state_length = 0, wrap = FALSE)
animate(p, nframes = 60, fps = 20)
anim_save("images/gganimate.gif", p, nframes = 60, fps = 20)
}
```

Future
------------------------------------------------------------------------------

* Include more examples

<img src="images/gganimate.gif" alt="ggpattern + gganimate">

0 comments on commit 91ec6f4

Please sign in to comment.