-
Notifications
You must be signed in to change notification settings - Fork 39
/
ggtech.html
397 lines (311 loc) · 14.2 KB
/
ggtech.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>ggplot2 extensions: ggtech</title>
<script src="libs/jquery-1.11.3/jquery.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="libs/bootstrap-3.3.5/css/cosmo.min.css" rel="stylesheet" />
<script src="libs/bootstrap-3.3.5/js/bootstrap.min.js"></script>
<script src="libs/bootstrap-3.3.5/shim/html5shiv.min.js"></script>
<script src="libs/bootstrap-3.3.5/shim/respond.min.js"></script>
<!-- Styles for this site -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="css/styles.css" rel="stylesheet">
<!-- Polyfill JS -->
<script src="js/polyfill.js"></script>
<style type="text/css">code{white-space: pre;}</style>
<link rel="stylesheet"
href="libs/highlight/textmate.css"
type="text/css" />
<script src="libs/highlight/highlight.js"></script>
<style type="text/css">
pre:not([class]) {
background-color: white;
}
</style>
<script type="text/javascript">
if (window.hljs && document.readyState && document.readyState === "complete") {
window.setTimeout(function() {
hljs.initHighlighting();
}, 0);
}
</script>
</head>
<body>
<style type = "text/css">
.main-container {
max-width: 940px;
margin-left: auto;
margin-right: auto;
}
code {
color: inherit;
background-color: rgba(0, 0, 0, 0.04);
}
img {
max-width:100%;
height: auto;
}
h1 {
font-size: 34px;
}
h1.title {
font-size: 38px;
}
h2 {
font-size: 30px;
}
h3 {
font-size: 24px;
}
h4 {
font-size: 18px;
}
h5 {
font-size: 16px;
}
h6 {
font-size: 12px;
}
.tabbed-pane {
padding-top: 12px;
}
button.code-folding-btn:focus {
outline: none;
}
</style>
<div class="container-fluid main-container">
<!-- tabsets -->
<script src="libs/navigation-1.0/tabsets.js"></script>
<script>
$(document).ready(function () {
window.buildTabsets("TOC");
});
</script>
<!-- code folding -->
<!--html_preserve-->
<div class="header">
<nav class="navbar">
<h3 class="navbar-left"><strong>ggplot2</strong> extensions</h3>
<ul class="nav nav-pills navbar-right">
<li role="presentation" id="nav-home"><a href="index.html">Home</a></li>
<li role="presentation" id="nav-showcase"><a href="ggiraph.html">Extensions</a></li>
<li role="presentation" id="nav-github"><a href="https://github.com/ggplot2-exts/ggplot2-exts.github.io">GitHub</a></li>
</ul>
</nav>
</div>
<div class="showcase-header">
<div id = "showcase-intro">
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.
</div>
<div class="container-fluid">
<div class="row">
<div class="col-sm-4">
<div class="list-group">
<a href="ggiraph.html" class="list-group-item">
<h5 class="list-group-item-heading">ggiraph</h5>
<p class="list-group-item-text">Make ggplot interactive</p>
</a>
<a href="ggstance.html" class="list-group-item">
<h5 class="list-group-item-heading">ggstance</h5>
<p class="list-group-item-text">Horizontal versions of ggplot2 geoms</p>
</a>
<a href="ggalt.html" class="list-group-item">
<h5 class="list-group-item-heading">ggalt</h5>
<p class="list-group-item-text">Extra coordinate systems, geoms & stats</p>
</a>
<a href="ggforce.html" class="list-group-item">
<h5 class="list-group-item-heading">ggforce</h5>
<p class="list-group-item-text">Accelarating ggplot2</p>
</a>
<a href="ggrepel.html" class="list-group-item">
<h5 class="list-group-item-heading">ggrepel</h5>
<p class="list-group-item-text">Repel overlapping text labels</p>
</a>
<a href="ggraph.html" class="list-group-item">
<h5 class="list-group-item-heading">ggraph</h5>
<p class="list-group-item-text">Plot graph-like data structures</p>
</a>
<a href="ggpmisc.html" class="list-group-item">
<h5 class="list-group-item-heading">ggpmisc</h5>
<p class="list-group-item-text">Miscellaneous extensions to ggplot2</p>
</a>
<a href="geomnet.html" class="list-group-item">
<h5 class="list-group-item-heading">geomnet</h5>
<p class="list-group-item-text">Network visualizations in ggplot2</p>
</a>
<a href="ggExtra.html" class="list-group-item">
<h5 class="list-group-item-heading">ggExtra</h5>
<p class="list-group-item-text">Marginal density plots or histograms</p>
</a>
<a href="gganimate.html" class="list-group-item">
<h5 class="list-group-item-heading">gganimate</h5>
<p class="list-group-item-text">Create easy animations with ggplot2</p>
</a>
<a href="plotROC.html" class="list-group-item">
<h5 class="list-group-item-heading">plotROC</h5>
<p class="list-group-item-text">Interactive ROC plots</p>
</a>
<a href="ggthemes.html" class="list-group-item">
<h5 class="list-group-item-heading">ggthemes</h5>
<p class="list-group-item-text">ggplot themes and scales</p>
</a>
<a href="ggspectra.html" class="list-group-item">
<h5 class="list-group-item-heading">ggspectra</h5>
<p class="list-group-item-text">Extensions for radiation spectra</p>
</a>
<a href="ggnetwork.html" class="list-group-item">
<h5 class="list-group-item-heading">ggnetwork</h5>
<p class="list-group-item-text">Geoms to plot networks with ggplot2</p>
</a>
<a href="ggtech.html" class="list-group-item">
<h5 class="list-group-item-heading">ggtech</h5>
<p class="list-group-item-text">ggplot2 tech themes, scales, and geoms</p>
</a>
<a href="ggradar.html" class="list-group-item">
<h5 class="list-group-item-heading">ggradar</h5>
<p class="list-group-item-text">radar charts with ggplot2</p>
</a>
<a href="ggTimeSeries.html" class="list-group-item">
<h5 class="list-group-item-heading">ggTimeSeries</h5>
<p class="list-group-item-text">Time series visualisations</p>
</a>
<a href="ggtree.html" class="list-group-item">
<h5 class="list-group-item-heading">ggtree</h5>
<p class="list-group-item-text">A phylogenetic tree viewer</p>
</a>
<a href="ggseas.html" class="list-group-item">
<h5 class="list-group-item-heading">ggseas</h5>
<p class="list-group-item-text">Seasonal adjustment on the fly</p>
</a>
</div> <!-- list-group -->
</div> <!-- col-sm-4 -->
<div id="ggtech" class="col-sm-8">
<h3>ggtech</h3>
<p><a href="https://github.com/ricardo-bion/ggtech" class="uri">https://github.com/ricardo-bion/ggtech</a></p>
<p>ggplot2 tech themes, scales, and geoms.</p>
<pre class="r"><code># Example from https://github.com/ricardo-bion/ggtech
library(ggplot2)
library(ggtech)
# Make sure to install the required fonts
# (instructions at the end of this file).
extrafont::font_import(pattern = 'Guardian-EgypTT-Text-Regular.ttf', prompt=FALSE)
d <- qplot(carat, data = diamonds[diamonds$color %in%LETTERS[4:7], ], geom = "histogram", bins=30, fill = color)</code></pre>
<p>Tech themes and scales:</p>
<pre class="r"><code>d + theme_tech(theme="airbnb") + ggtitle("Airbnb ggplot2 theme") + scale_fill_tech(theme="airbnb")</code></pre>
<p><img src="ggtech_files/figure-html/unnamed-chunk-2-1.png" title="" alt="" width="576" /></p>
<pre class="r"><code>d + theme_tech(theme="etsy") + ggtitle("Etsy ggplot2 theme") + scale_fill_tech(theme="etsy")</code></pre>
<p><img src="ggtech_files/figure-html/unnamed-chunk-3-1.png" title="" alt="" width="576" /></p>
<pre class="r"><code>d + theme_tech(theme="facebook") + ggtitle("Facebook ggplot2 theme") + scale_fill_tech(theme="facebook")</code></pre>
<p><img src="ggtech_files/figure-html/unnamed-chunk-4-1.png" title="" alt="" width="576" /></p>
<pre class="r"><code>d + theme_tech(theme="google") + ggtitle("Google ggplot2 theme") + scale_fill_tech(theme="google")</code></pre>
<p><img src="ggtech_files/figure-html/unnamed-chunk-5-1.png" title="" alt="" width="576" /></p>
<pre class="r"><code>d + theme_tech(theme="twitter") + ggtitle("Twitter ggplot2 theme") + scale_fill_tech(theme="twitter")</code></pre>
<p><img src="ggtech_files/figure-html/unnamed-chunk-6-1.png" title="" alt="" width="576" /></p>
<p>Tech geoms, inspired by <a href="https://github.com/dill/emoGG">emoGG</a>.</p>
<pre class="r"><code>d2 <- data.frame(x = c(1:4, 3:1), y=1:7)</code></pre>
<pre class="r"><code>ggplot(aes(x,y), data=d2) +
geom_tech(size=0.25, theme="airbnb") +
theme_tech("airbnb") +
ggtitle("Airbnb geom")</code></pre>
<p><img src="ggtech_files/figure-html/unnamed-chunk-8-1.png" title="" alt="" width="576" /></p>
<pre class="r"><code>ggplot(aes(x,y), data=d2) +
geom_tech(size=0.15, theme="etsy") +
theme_tech("etsy")+
ggtitle("Etsy geom")</code></pre>
<p><img src="ggtech_files/figure-html/unnamed-chunk-9-1.png" title="" alt="" width="576" /></p>
<pre class="r"><code>ggplot(aes(x,y), data=d2) +
geom_tech(size=0.15, theme="facebook") +
theme_tech("facebook")+
ggtitle("Facebook geom")</code></pre>
<p><img src="ggtech_files/figure-html/unnamed-chunk-10-1.png" title="" alt="" width="576" /></p>
<pre class="r"><code>ggplot(aes(x,y), data=d2) +
geom_tech(size=0.25, theme="google") +
theme_tech("google" ) +
ggtitle("Google geom")</code></pre>
<p><img src="ggtech_files/figure-html/unnamed-chunk-11-1.png" title="" alt="" width="576" /></p>
<pre class="r"><code>ggplot(aes(x,y), data=d2) +
geom_tech(size=0.15, theme="twitter") +
theme_tech("twitter") +
ggtitle("Twitter geom")</code></pre>
<p><img src="ggtech_files/figure-html/unnamed-chunk-12-1.png" title="" alt="" width="576" /></p>
</div> <!-- col-sm-8 -->
</div> <!-- row -->
</div>
</div> <!-- showcase-header -->
<!--/html_preserve-->
<div id="install-fonts" class="section level3">
<h3>Install fonts:</h3>
<p>You have to install the necessary fonts manually before using <code>ggtech</code>. Mofidy the <code>destfile</code> if you are using Windows or Unix.</p>
<pre class="r"><code>## Facebook
download.file("http://social-fonts.com/assets/fonts/facebook-letter-faces/facebook-letter-faces.ttf", "/Library/Fonts/facebook-letter-faces.ttf", method="curl")
font_import(pattern = 'facebook-letter-faces.ttf', prompt=FALSE)
font_import(pattern = 'Lucida', prompt=FALSE)
## Google
download.file("http://social-fonts.com/assets/fonts/product-sans/product-sans.ttf", "/Library/Fonts/product-sans.ttf", method="curl")
font_import(pattern = 'product-sans.ttf', prompt=FALSE)
font_import(pattern = 'Roboto', prompt=FALSE)
## Airbnb
download.file("https://dl.dropboxusercontent.com/u/2364714/airbnb_ttf_fonts/Circular%20Air-Medium%203.46.45%20PM.ttf", "/Library/Fonts/Circular Air-Medium 3.46.45 PM.ttf", method="curl")
download.file("https://dl.dropboxusercontent.com/u/2364714/airbnb_ttf_fonts/Circular%20Air-Bold%203.46.45%20PM.ttf", "/Library/Fonts/Circular Air-Bold 3.46.45 PM.ttf", method="curl")
font_import(pattern = 'Circular', prompt=FALSE)
## Etsy
download.file("https://www.etsy.com/assets/type/Guardian-EgypTT-Text-Regular.ttf", "/Library/Fonts/Guardian-EgypTT-Text-Regular.ttf", method="curl")
font_import(pattern = 'Guardian-EgypTT-Text-Regular.ttf', prompt=FALSE)
## Twitter
download.file("http://social-fonts.com/assets/fonts/pico-black/pico-black.ttf", "/Library/Fonts/pico-black.ttf", method="curl")
download.file("http://social-fonts.com/assets/fonts/arista-light/arista-light.ttf", "/Library/Fonts/arista-light.ttf", method="curl")
font_import(pattern = 'pico-black.ttf', prompt=FALSE)
font_import(pattern = 'arista-light.ttf', prompt=FALSE)</code></pre>
</div>
</div> <!-- page-body -->
<footer>
<div> </div>
<div> </div>
<div class="text-muted">
Design inspired by <a href="http://www.htmlwidgets.org/index.html" target="_blank">Ramnath Vaidyanathan, Kenton Russell, and RStudio, Inc</a>.
</div>
<div class="text-muted">
Maintained by <a href="http://www.danielemaasit.com" target="_blank">Daniel Emaasit</a>.
</div>
<div class="text-muted">
Copyright © 2016 The R Community.
</div>
</footer>
<script>
// manage active state of headres and navigation based on current page
$(document).ready(function () {
// compute name of page
href = window.location.pathname;
href = href.substr(href.lastIndexOf('/') + 1);
if (href == "")
href = "index.html";
// main navigation and headers
if (href.startsWith("index")) {
$('#nav-home').addClass('active');
$('.title').addClass('hidden');
} else if (href.startsWith("showcase")) {
$('#nav-showcase').addClass('active');
$("#page-body").detach().appendTo('#showcase-body');
$('.showcase-header').removeClass('hidden');
$('.title').addClass('hidden');
} else if (href.startsWith("develop")) {
$('#nav-develop').addClass('active');
}
// submenu navigation (used by showcase and develop)
$('.list-group a[href="' + href + '"]').addClass('active');
});
</script>
</div>
<script>
// add bootstrap table styles to pandoc tables
$(document).ready(function () {
$('tr.header').parent('thead').parent('table').addClass('table table-condensed');
});
</script>
</body>
</html>