Skip to content

Commit 27b34b9

Browse files
committed
added 5 more exts
1 parent dab7d45 commit 27b34b9

23 files changed

+1425
-7
lines changed

Diff for: ggalt.Rmd

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
title: "ggplot2 extensions: ggalt"
3+
---
4+
5+
### ggalt
6+
<https://github.com/hrbrmstr/ggalt>
7+
8+
A compendium of 'geoms', 'coords' and 'stats' for 'ggplot2', including splines, 1d and 2d densities, univariate average shifted histograms and a new map coordinate system based on the 'PROJ.4'-library..
9+
10+
```{r, message=FALSE,warning=FALSE}
11+
# Example from https://github.com/hrbrmstr/ggalt
12+
library(ggplot2)
13+
library(gridExtra)
14+
library(ggalt)
15+
16+
set.seed(1492)
17+
dat <- data.frame(x=c(1:10, 1:10, 1:10),
18+
y=c(sample(15:30, 10), 2*sample(15:30, 10), 3*sample(15:30, 10)),
19+
group=factor(c(rep(1, 10), rep(2, 10), rep(3, 10)))
20+
)
21+
22+
ggplot(dat, aes(x, y, group=group, color=factor(group))) +
23+
geom_point(color="black") +
24+
geom_smooth(se=FALSE, linetype="dashed", size=0.5) +
25+
geom_xspline(spline_shape=-0.4, size=0.5)
26+
27+
## Alternate 2D density plots
28+
29+
ggplot(faithful, aes(x = eruptions, y = waiting)) +
30+
geom_point() +
31+
xlim(0.5, 6) +
32+
ylim(40, 110) +
33+
geom_bkde2d(bandwidth=c(0.5, 4))
34+
```

Diff for: ggalt.html

+235
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
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: ggalt</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+
</div> <!-- list-group -->
130+
131+
</div> <!-- col-sm-4 -->
132+
133+
<div id="ggalt" class="col-sm-8">
134+
<h3>ggalt</h3>
135+
<p><a href="https://github.com/hrbrmstr/ggalt" class="uri">https://github.com/hrbrmstr/ggalt</a></p>
136+
<p>A compendium of ‘geoms’, ‘coords’ and ‘stats’ for ‘ggplot2’, including splines, 1d and 2d densities, univariate average shifted histograms and a new map coordinate system based on the ‘PROJ.4’-library..</p>
137+
<pre class="r"><code># Example from https://github.com/hrbrmstr/ggalt
138+
library(ggplot2)
139+
library(gridExtra)
140+
library(ggalt)
141+
142+
set.seed(1492)
143+
dat &lt;- data.frame(x=c(1:10, 1:10, 1:10),
144+
y=c(sample(15:30, 10), 2*sample(15:30, 10), 3*sample(15:30, 10)),
145+
group=factor(c(rep(1, 10), rep(2, 10), rep(3, 10)))
146+
)
147+
148+
ggplot(dat, aes(x, y, group=group, color=factor(group))) +
149+
geom_point(color=&quot;black&quot;) +
150+
geom_smooth(se=FALSE, linetype=&quot;dashed&quot;, size=0.5) +
151+
geom_xspline(spline_shape=-0.4, size=0.5)</code></pre>
152+
<p><img src="ggalt_files/figure-html/unnamed-chunk-1-1.png" title="" alt="" width="576" /></p>
153+
<pre class="r"><code>## Alternate 2D density plots
154+
155+
ggplot(faithful, aes(x = eruptions, y = waiting)) +
156+
geom_point() +
157+
xlim(0.5, 6) +
158+
ylim(40, 110) +
159+
geom_bkde2d(bandwidth=c(0.5, 4))</code></pre>
160+
<p><img src="ggalt_files/figure-html/unnamed-chunk-1-2.png" title="" alt="" width="576" /></p>
161+
</div> <!-- col-sm-8 -->
162+
163+
</div> <!-- row -->
164+
</div>
165+
166+
</div> <!-- showcase-header -->
167+
168+
169+
170+
<!--/html_preserve-->
171+
172+
173+
174+
175+
176+
</div> <!-- page-body -->
177+
178+
<footer>
179+
<div>&nbsp;</div>
180+
<div>&nbsp;</div>
181+
<div class="text-muted">
182+
Design inspired by <a href="http://www.htmlwidgets.org/index.html" target="_blank">Ramnath Vaidyanathan, Kenton Russell, and RStudio, Inc</a>.
183+
</div>
184+
<div class="text-muted">
185+
Maintained by <a href="http://www.danielemaasit.com" target="_blank">Daniel Emaasit</a>.
186+
</div>
187+
<div class="text-muted">
188+
Copyright &copy; 2016 The R Community.
189+
</div>
190+
</footer>
191+
192+
<script>
193+
// manage active state of headres and navigation based on current page
194+
195+
$(document).ready(function () {
196+
197+
// compute name of page
198+
href = window.location.pathname;
199+
href = href.substr(href.lastIndexOf('/') + 1);
200+
if (href == "")
201+
href = "index.html";
202+
203+
// main navigation and headers
204+
if (href.startsWith("index")) {
205+
$('#nav-home').addClass('active');
206+
$('.title').addClass('hidden');
207+
} else if (href.startsWith("showcase")) {
208+
$('#nav-showcase').addClass('active');
209+
$("#page-body").detach().appendTo('#showcase-body');
210+
$('.showcase-header').removeClass('hidden');
211+
$('.title').addClass('hidden');
212+
} else if (href.startsWith("develop")) {
213+
$('#nav-develop').addClass('active');
214+
}
215+
216+
// submenu navigation (used by showcase and develop)
217+
$('.list-group a[href="' + href + '"]').addClass('active');
218+
});
219+
220+
</script>
221+
222+
</div>
223+
224+
<script>
225+
226+
// add bootstrap table styles to pandoc tables
227+
$(document).ready(function () {
228+
$('tr.header').parent('thead').parent('table').addClass('table table-condensed');
229+
});
230+
231+
</script>
232+
233+
234+
</body>
235+
</html>

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

78.2 KB
Loading

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

144 KB
Loading

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

78.2 KB
Loading

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

144 KB
Loading

Diff for: ggforce.Rmd

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: "ggplot2 extensions: ggforce"
3+
---
4+
5+
### ggforce
6+
<https://github.com/thomasp85/ggforce>
7+
8+
ggforce is aimed at providing missing functionality to ggplot2 through the extension system introduced with ggplot2 v2.0.0.
9+
10+
```{r, message=FALSE,warning=FALSE}
11+
# Example from https://github.com/thomasp85/ggforce
12+
library(ggplot2)
13+
library(ggforce)
14+
15+
# We'll start by defining some dummy data
16+
pie <- data.frame(
17+
state = c('eaten', 'eaten but said you didn\'t', 'cat took it',
18+
'for tonight', 'will decompose slowly'),
19+
focus = c(0.2, 0, 0, 0, 0),
20+
start = c(0, 1, 2, 3, 4),
21+
end = c(1, 2, 3, 4, 2*pi),
22+
amount = c(4,3, 1, 1.5, 6),
23+
stringsAsFactors = FALSE
24+
)
25+
26+
p <- ggplot() + theme_no_axes() + coord_fixed()
27+
28+
# For low level control you define the start and end angles yourself
29+
p + geom_arc_bar(aes(x0 = 0, y0 = 0, r0 = 0, r = 1, start = start, end = end,
30+
fill = state),
31+
data = pie)
32+
33+
# Here are some data describing some circles
34+
circles <- data.frame(
35+
x0 = rep(1:3, 2),
36+
y0 = rep(1:2, each=3),
37+
r = seq(0.1, 1, length.out = 6)
38+
)
39+
ggplot() + geom_circle(aes(x0=x0, y0=y0, r=r, fill=r), data=circles)
40+
```

0 commit comments

Comments
 (0)