Skip to content

Commit e2c420b

Browse files
committed
added gganimate
1 parent ca403f4 commit e2c420b

26 files changed

+316
-2
lines changed

Diff for: geomnet.html

+4
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ <h5 class="list-group-item-heading">geomnet</h5>
134134
<h5 class="list-group-item-heading">ggExtra</h5>
135135
<p class="list-group-item-text">Marginal density plots or histograms</p>
136136
</a>
137+
<a href="gganimate.html" class="list-group-item">
138+
<h5 class="list-group-item-heading">gganimate</h5>
139+
<p class="list-group-item-text">Create easy animations with ggplot2</p>
140+
</a>
137141

138142
</div> <!-- list-group -->
139143

Diff for: geomnet_files/figure-html/unnamed-chunk-1-1.png

-517 Bytes
Loading

Diff for: ggExtra.html

+4
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ <h5 class="list-group-item-heading">geomnet</h5>
134134
<h5 class="list-group-item-heading">ggExtra</h5>
135135
<p class="list-group-item-text">Marginal density plots or histograms</p>
136136
</a>
137+
<a href="gganimate.html" class="list-group-item">
138+
<h5 class="list-group-item-heading">gganimate</h5>
139+
<p class="list-group-item-text">Create easy animations with ggplot2</p>
140+
</a>
137141

138142
</div> <!-- list-group -->
139143

Diff for: ggalt.html

+4
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ <h5 class="list-group-item-heading">geomnet</h5>
134134
<h5 class="list-group-item-heading">ggExtra</h5>
135135
<p class="list-group-item-text">Marginal density plots or histograms</p>
136136
</a>
137+
<a href="gganimate.html" class="list-group-item">
138+
<h5 class="list-group-item-heading">gganimate</h5>
139+
<p class="list-group-item-text">Create easy animations with ggplot2</p>
140+
</a>
137141

138142
</div> <!-- list-group -->
139143

Diff for: gganimate.Rmd

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: "ggplot2 extensions: gganimate"
3+
---
4+
5+
### gganimate
6+
<https://github.com/dgrtwo/gganimate>
7+
8+
gganimate wraps the animation package to create animated ggplot2 plots.
9+
10+
```{r eval = FALSE}
11+
knitr::opts_chunk$set(message = FALSE, warning = FALSE, fig.show = "animate")
12+
# Example from https://github.com/dgrtwo/gganimate
13+
library(ggplot2)
14+
library(gganimate)
15+
16+
# For example, suppose we wanted to create an animation similar to the Gapminder
17+
# world animation, using Jenny Bryan's gapminder package for the data.
18+
library(gapminder)
19+
20+
theme_set(theme_bw())
21+
p <- ggplot(gapminder, aes(gdpPercap, lifeExp, size = pop, color = continent, frame = year)) +
22+
geom_point() +
23+
scale_x_log10()
24+
25+
# Notice we added frame = year and saved the plot as p.
26+
# We then display it as an animation with the gg_animate function:
27+
gg_animate(p)
28+
```
29+
30+
![unnamed-chunk-3](images/output.gif)

Diff for: gganimate.html

+244
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,244 @@
1+
<!DOCTYPE html>
2+
3+
<html xmlns="http://www.w3.org/1999/xhtml">
4+
5+
<head>
6+
7+
<meta charset="utf-8">
8+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9+
<meta name="generator" content="pandoc" />
10+
11+
12+
13+
<title>ggplot2 extensions: gganimate</title>
14+
15+
<script src="libs/jquery-1.11.0/jquery.min.js"></script>
16+
<meta name="viewport" content="width=device-width, initial-scale=1" />
17+
<link href="libs/bootstrap-3.3.1/css/cosmo.min.css" rel="stylesheet" />
18+
<script src="libs/bootstrap-3.3.1/js/bootstrap.min.js"></script>
19+
<script src="libs/bootstrap-3.3.1/shim/html5shiv.min.js"></script>
20+
<script src="libs/bootstrap-3.3.1/shim/respond.min.js"></script>
21+
22+
<!-- Styles for this site -->
23+
<meta name="viewport" content="width=device-width, initial-scale=1">
24+
<link href="css/styles.css" rel="stylesheet">
25+
26+
27+
<!-- Polyfill JS -->
28+
<script src="js/polyfill.js"></script>
29+
30+
<style type="text/css">code{white-space: pre;}</style>
31+
<link rel="stylesheet"
32+
href="libs/highlight/textmate.css"
33+
type="text/css" />
34+
<script src="libs/highlight/highlight.js"></script>
35+
<style type="text/css">
36+
pre:not([class]) {
37+
background-color: white;
38+
}
39+
</style>
40+
<script type="text/javascript">
41+
if (window.hljs && document.readyState && document.readyState === "complete") {
42+
window.setTimeout(function() {
43+
hljs.initHighlighting();
44+
}, 0);
45+
}
46+
</script>
47+
48+
49+
50+
</head>
51+
52+
<body>
53+
54+
<style type = "text/css">
55+
.main-container {
56+
max-width: 940px;
57+
margin-left: auto;
58+
margin-right: auto;
59+
}
60+
code {
61+
color: inherit;
62+
background-color: rgba(0, 0, 0, 0.04);
63+
}
64+
img {
65+
max-width:100%;
66+
height: auto;
67+
}
68+
</style>
69+
<div class="container-fluid main-container">
70+
71+
<!--html_preserve-->
72+
73+
<div class="header">
74+
<nav class="navbar">
75+
<h3 class="navbar-left"><strong>ggplot2</strong> extensions</h3>
76+
<ul class="nav nav-pills navbar-right">
77+
<li role="presentation" id="nav-home"><a href="index.html">Home</a></li>
78+
<li role="presentation" id="nav-showcase"><a href="ggiraph.html">Extensions</a></li>
79+
<li role="presentation" id="nav-github"><a href="https://github.com/ggplot2-exts/ggplot2-exts.github.io">GitHub</a></li>
80+
</ul>
81+
</nav>
82+
</div>
83+
84+
<div class="showcase-header">
85+
86+
<div id = "showcase-intro">
87+
ggplot2 now has an official extension mechanism. This means that others can now easily create their own stats, geoms and positions, and provide them in other packages. This should allow the ggplot2 community to flourish, even as less development work happens in ggplot2 itself. This page showcases these extensions.
88+
</div>
89+
90+
<div class="container-fluid">
91+
<div class="row">
92+
93+
<div class="col-sm-4">
94+
<div class="list-group">
95+
<a href="ggiraph.html" class="list-group-item">
96+
<h5 class="list-group-item-heading">ggiraph</h5>
97+
<p class="list-group-item-text">Make ggplot interactive</p>
98+
</a>
99+
<a href="ggstance.html" class="list-group-item">
100+
<h5 class="list-group-item-heading">ggstance</h5>
101+
<p class="list-group-item-text">Horizontal versions of ggplot2 geoms</p>
102+
</a>
103+
104+
<a href="ggalt.html" class="list-group-item">
105+
<h5 class="list-group-item-heading">ggalt</h5>
106+
<p class="list-group-item-text">Extra coordinate systems, geoms & stats</p>
107+
</a>
108+
109+
<a href="ggforce.html" class="list-group-item">
110+
<h5 class="list-group-item-heading">ggforce</h5>
111+
<p class="list-group-item-text">Accelarating ggplot2</p>
112+
</a>
113+
114+
<a href="ggrepel.html" class="list-group-item">
115+
<h5 class="list-group-item-heading">ggrepel</h5>
116+
<p class="list-group-item-text">Repel overlapping text labels</p>
117+
</a>
118+
119+
<a href="ggraph.html" class="list-group-item">
120+
<h5 class="list-group-item-heading">ggraph</h5>
121+
<p class="list-group-item-text">Plot graph-like data structures</p>
122+
</a>
123+
124+
<a href="ggpmisc.html" class="list-group-item">
125+
<h5 class="list-group-item-heading">ggpmisc</h5>
126+
<p class="list-group-item-text">Miscellaneous extensions to ggplot2</p>
127+
</a>
128+
129+
<a href="geomnet.html" class="list-group-item">
130+
<h5 class="list-group-item-heading">geomnet</h5>
131+
<p class="list-group-item-text">Network visualizations in ggplot2</p>
132+
</a>
133+
<a href="ggExtra.html" class="list-group-item">
134+
<h5 class="list-group-item-heading">ggExtra</h5>
135+
<p class="list-group-item-text">Marginal density plots or histograms</p>
136+
</a>
137+
<a href="gganimate.html" class="list-group-item">
138+
<h5 class="list-group-item-heading">gganimate</h5>
139+
<p class="list-group-item-text">Create easy animations with ggplot2</p>
140+
</a>
141+
142+
</div> <!-- list-group -->
143+
144+
</div> <!-- col-sm-4 -->
145+
146+
<div id="gganimate" class="col-sm-8">
147+
<h3>gganimate</h3>
148+
<p><a href="https://github.com/dgrtwo/gganimate" class="uri">https://github.com/dgrtwo/gganimate</a></p>
149+
<p>gganimate wraps the animation package to create animated ggplot2 plots.</p>
150+
<pre class="r"><code>knitr::opts_chunk$set(message = FALSE, warning = FALSE, fig.show = &quot;animate&quot;)
151+
# Example from https://github.com/dgrtwo/gganimate
152+
library(ggplot2)
153+
library(gganimate)
154+
155+
# For example, suppose we wanted to create an animation similar to the Gapminder
156+
# world animation, using Jenny Bryan&#39;s gapminder package for the data.
157+
library(gapminder)
158+
159+
theme_set(theme_bw())
160+
p &lt;- ggplot(gapminder, aes(gdpPercap, lifeExp, size = pop, color = continent, frame = year)) +
161+
geom_point() +
162+
scale_x_log10()
163+
164+
# Notice we added frame = year and saved the plot as p.
165+
# We then display it as an animation with the gg_animate function:
166+
gg_animate(p)</code></pre>
167+
<p><img src="images/output.gif" alt="unnamed-chunk-3" /></p>
168+
</div> <!-- col-sm-8 -->
169+
170+
</div> <!-- row -->
171+
</div>
172+
173+
</div> <!-- showcase-header -->
174+
175+
176+
177+
<!--/html_preserve-->
178+
179+
180+
181+
182+
183+
184+
185+
</div> <!-- page-body -->
186+
187+
<footer>
188+
<div>&nbsp;</div>
189+
<div>&nbsp;</div>
190+
<div class="text-muted">
191+
Design inspired by <a href="http://www.htmlwidgets.org/index.html" target="_blank">Ramnath Vaidyanathan, Kenton Russell, and RStudio, Inc</a>.
192+
</div>
193+
<div class="text-muted">
194+
Maintained by <a href="http://www.danielemaasit.com" target="_blank">Daniel Emaasit</a>.
195+
</div>
196+
<div class="text-muted">
197+
Copyright &copy; 2016 The R Community.
198+
</div>
199+
</footer>
200+
201+
<script>
202+
// manage active state of headres and navigation based on current page
203+
204+
$(document).ready(function () {
205+
206+
// compute name of page
207+
href = window.location.pathname;
208+
href = href.substr(href.lastIndexOf('/') + 1);
209+
if (href == "")
210+
href = "index.html";
211+
212+
// main navigation and headers
213+
if (href.startsWith("index")) {
214+
$('#nav-home').addClass('active');
215+
$('.title').addClass('hidden');
216+
} else if (href.startsWith("showcase")) {
217+
$('#nav-showcase').addClass('active');
218+
$("#page-body").detach().appendTo('#showcase-body');
219+
$('.showcase-header').removeClass('hidden');
220+
$('.title').addClass('hidden');
221+
} else if (href.startsWith("develop")) {
222+
$('#nav-develop').addClass('active');
223+
}
224+
225+
// submenu navigation (used by showcase and develop)
226+
$('.list-group a[href="' + href + '"]').addClass('active');
227+
});
228+
229+
</script>
230+
231+
</div>
232+
233+
<script>
234+
235+
// add bootstrap table styles to pandoc tables
236+
$(document).ready(function () {
237+
$('tr.header').parent('thead').parent('table').addClass('table table-condensed');
238+
});
239+
240+
</script>
241+
242+
243+
</body>
244+
</html>

Diff for: gganimate_files/figure-html/unnamed-chunk-1-1.png

77.8 KB
Loading

Diff for: gganimate_files/figure-html/unnamed-chunk-1-10.png

77.8 KB
Loading

Diff for: gganimate_files/figure-html/unnamed-chunk-1-11.png

77.5 KB
Loading

Diff for: gganimate_files/figure-html/unnamed-chunk-1-12.png

78.8 KB
Loading

Diff for: gganimate_files/figure-html/unnamed-chunk-1-2.png

78.4 KB
Loading

Diff for: gganimate_files/figure-html/unnamed-chunk-1-3.png

78.1 KB
Loading

Diff for: gganimate_files/figure-html/unnamed-chunk-1-4.png

78.5 KB
Loading

Diff for: gganimate_files/figure-html/unnamed-chunk-1-5.png

79 KB
Loading

Diff for: gganimate_files/figure-html/unnamed-chunk-1-6.png

78.3 KB
Loading

Diff for: gganimate_files/figure-html/unnamed-chunk-1-7.png

79.7 KB
Loading

Diff for: gganimate_files/figure-html/unnamed-chunk-1-8.png

79.3 KB
Loading

Diff for: gganimate_files/figure-html/unnamed-chunk-1-9.png

78.1 KB
Loading

Diff for: ggforce.html

+4
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ <h5 class="list-group-item-heading">geomnet</h5>
134134
<h5 class="list-group-item-heading">ggExtra</h5>
135135
<p class="list-group-item-text">Marginal density plots or histograms</p>
136136
</a>
137+
<a href="gganimate.html" class="list-group-item">
138+
<h5 class="list-group-item-heading">gganimate</h5>
139+
<p class="list-group-item-text">Create easy animations with ggplot2</p>
140+
</a>
137141

138142
</div> <!-- list-group -->
139143

Diff for: ggiraph.html

+6-2
Large diffs are not rendered by default.

Diff for: ggpmisc.html

+4
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ <h5 class="list-group-item-heading">geomnet</h5>
134134
<h5 class="list-group-item-heading">ggExtra</h5>
135135
<p class="list-group-item-text">Marginal density plots or histograms</p>
136136
</a>
137+
<a href="gganimate.html" class="list-group-item">
138+
<h5 class="list-group-item-heading">gganimate</h5>
139+
<p class="list-group-item-text">Create easy animations with ggplot2</p>
140+
</a>
137141

138142
</div> <!-- list-group -->
139143

Diff for: ggraph.html

+4
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ <h5 class="list-group-item-heading">geomnet</h5>
134134
<h5 class="list-group-item-heading">ggExtra</h5>
135135
<p class="list-group-item-text">Marginal density plots or histograms</p>
136136
</a>
137+
<a href="gganimate.html" class="list-group-item">
138+
<h5 class="list-group-item-heading">gganimate</h5>
139+
<p class="list-group-item-text">Create easy animations with ggplot2</p>
140+
</a>
137141

138142
</div> <!-- list-group -->
139143

Diff for: ggrepel.html

+4
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ <h5 class="list-group-item-heading">geomnet</h5>
134134
<h5 class="list-group-item-heading">ggExtra</h5>
135135
<p class="list-group-item-text">Marginal density plots or histograms</p>
136136
</a>
137+
<a href="gganimate.html" class="list-group-item">
138+
<h5 class="list-group-item-heading">gganimate</h5>
139+
<p class="list-group-item-text">Create easy animations with ggplot2</p>
140+
</a>
137141

138142
</div> <!-- list-group -->
139143

Diff for: ggstance.html

+4
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ <h5 class="list-group-item-heading">geomnet</h5>
134134
<h5 class="list-group-item-heading">ggExtra</h5>
135135
<p class="list-group-item-text">Marginal density plots or histograms</p>
136136
</a>
137+
<a href="gganimate.html" class="list-group-item">
138+
<h5 class="list-group-item-heading">gganimate</h5>
139+
<p class="list-group-item-text">Create easy animations with ggplot2</p>
140+
</a>
137141

138142
</div> <!-- list-group -->
139143

Diff for: images/output.gif

181 KB
Loading

Diff for: include/before_body.html

+4
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ <h5 class="list-group-item-heading">geomnet</h5>
6464
<h5 class="list-group-item-heading">ggExtra</h5>
6565
<p class="list-group-item-text">Marginal density plots or histograms</p>
6666
</a>
67+
<a href="gganimate.html" class="list-group-item">
68+
<h5 class="list-group-item-heading">gganimate</h5>
69+
<p class="list-group-item-text">Create easy animations with ggplot2</p>
70+
</a>
6771

6872
</div> <!-- list-group -->
6973

0 commit comments

Comments
 (0)