-
Notifications
You must be signed in to change notification settings - Fork 0
/
dataviz0003.html
271 lines (236 loc) · 25.6 KB
/
dataviz0003.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="date" content="2021-01-03" />
<title>Breakfast_0003</title>
<script src="site_libs/accessible-code-block-0.0.1/empty-anchor.js"></script>
<link href="site_libs/anchor-sections-1.0/anchor-sections.css" rel="stylesheet" />
<script src="site_libs/anchor-sections-1.0/anchor-sections.js"></script>
<style type="text/css">code{white-space: pre;}</style>
<style type="text/css" data-origin="pandoc">
code.sourceCode > span { display: inline-block; line-height: 1.25; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode { white-space: pre; position: relative; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
code.sourceCode { white-space: pre-wrap; }
code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
color: #aaaaaa;
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span.al { color: #ff0000; font-weight: bold; } /* Alert */
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #7d9029; } /* Attribute */
code span.bn { color: #40a070; } /* BaseN */
code span.bu { } /* BuiltIn */
code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4070a0; } /* Char */
code span.cn { color: #880000; } /* Constant */
code span.co { color: #60a0b0; font-style: italic; } /* Comment */
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #ba2121; font-style: italic; } /* Documentation */
code span.dt { color: #902000; } /* DataType */
code span.dv { color: #40a070; } /* DecVal */
code span.er { color: #ff0000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #40a070; } /* Float */
code span.fu { color: #06287e; } /* Function */
code span.im { } /* Import */
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #007020; font-weight: bold; } /* Keyword */
code span.op { color: #666666; } /* Operator */
code span.ot { color: #007020; } /* Other */
code span.pp { color: #bc7a00; } /* Preprocessor */
code span.sc { color: #4070a0; } /* SpecialChar */
code span.ss { color: #bb6688; } /* SpecialString */
code span.st { color: #4070a0; } /* String */
code span.va { color: #19177c; } /* Variable */
code span.vs { color: #4070a0; } /* VerbatimString */
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
/* A workaround for https://github.com/jgm/pandoc/issues/4278 */
a.sourceLine {
pointer-events: auto;
}
</style>
<script>
// apply pandoc div.sourceCode style to pre.sourceCode instead
(function() {
var sheets = document.styleSheets;
for (var i = 0; i < sheets.length; i++) {
if (sheets[i].ownerNode.dataset["origin"] !== "pandoc") continue;
try { var rules = sheets[i].cssRules; } catch (e) { continue; }
for (var j = 0; j < rules.length; j++) {
var rule = rules[j];
// check if there is a div.sourceCode rule
if (rule.type !== rule.STYLE_RULE || rule.selectorText !== "div.sourceCode") continue;
var style = rule.style.cssText;
// check if color or background-color is set
if (rule.style.color === '' && rule.style.backgroundColor === '') continue;
// replace div.sourceCode by a pre.sourceCode rule
sheets[i].deleteRule(j);
sheets[i].insertRule('pre.sourceCode{' + style + '}', j);
}
}
})();
</script>
<link rel="stylesheet" href="dataviz0003_files/style.css" type="text/css" />
</head>
<body>
<div id="container">
<div class="inner">
<header>
<h1 class="title toc-ignore">Breakfast_0003</h1>
<h3 class="date">January 3, 2021</h3>
</header>
<hr>
<div id="hello-again-day-3-and-this-is-going-to-be-a-quick-one." class="section level2">
<h2>Hello again, Day 3 and this is going to be a quick one.</h2>
<p>Following on from yesterday, I will continue to reproduce Fig 1a. <img src="files/Large_image_Fig1.jpeg" /></p>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1"></a><span class="kw">library</span>(tidyverse)</span>
<span id="cb1-2"><a href="#cb1-2"></a></span>
<span id="cb1-3"><a href="#cb1-3"></a>dat03 <-<span class="st"> </span><span class="kw">read_csv</span>(<span class="st">"files/Dawtry Sutton and Sibley 2015 Study 1a.csv"</span>) </span>
<span id="cb1-4"><a href="#cb1-4"></a></span>
<span id="cb1-5"><a href="#cb1-5"></a>dat03 <-<span class="st"> </span>dat03 <span class="op">%>%</span><span class="st"> </span><span class="kw">select</span>(Household_Income, SC_<span class="dv">15</span>, SC_<span class="dv">30</span>, SC_<span class="dv">45</span>, SC_<span class="dv">60</span>, SC_<span class="dv">75</span>, SC_<span class="dv">90</span>, </span>
<span id="cb1-6"><a href="#cb1-6"></a> SC_<span class="dv">105</span>, SC_<span class="dv">120</span>, SC_<span class="dv">135</span>, SC_<span class="dv">150</span>, SC_150plus) <span class="op">%>%</span></span>
<span id="cb1-7"><a href="#cb1-7"></a><span class="st"> </span><span class="kw">mutate</span>(<span class="dt">tertile =</span> <span class="kw">ntile</span>(Household_Income, <span class="dv">3</span>)) <span class="op">%>%</span></span>
<span id="cb1-8"><a href="#cb1-8"></a><span class="st"> </span><span class="kw">filter</span>(tertile <span class="op">%in%</span><span class="st"> </span><span class="kw">c</span>(<span class="st">"1"</span>, <span class="st">"3"</span>)) <span class="op">%>%</span><span class="st"> </span></span>
<span id="cb1-9"><a href="#cb1-9"></a><span class="st"> </span><span class="kw">select</span>(<span class="op">-</span>Household_Income)</span>
<span id="cb1-10"><a href="#cb1-10"></a></span>
<span id="cb1-11"><a href="#cb1-11"></a>dat_tertile031 <-<span class="st"> </span>dat03 <span class="op">%>%</span><span class="st"> </span><span class="kw">filter</span>(tertile <span class="op">==</span><span class="st"> </span><span class="dv">1</span>) <span class="op">%>%</span></span>
<span id="cb1-12"><a href="#cb1-12"></a><span class="st"> </span><span class="kw">pivot_longer</span>(<span class="dt">cols =</span> <span class="kw">starts_with</span>(<span class="st">"SC_"</span>), </span>
<span id="cb1-13"><a href="#cb1-13"></a> <span class="dt">names_to =</span> <span class="st">"income_bracket"</span>, </span>
<span id="cb1-14"><a href="#cb1-14"></a> <span class="dt">values_to =</span> <span class="st">"count"</span>) <span class="op">%>%</span></span>
<span id="cb1-15"><a href="#cb1-15"></a><span class="st"> </span><span class="kw">group_by</span>(income_bracket) <span class="op">%>%</span></span>
<span id="cb1-16"><a href="#cb1-16"></a><span class="st"> </span><span class="kw">summarise</span>(<span class="dt">perc =</span> <span class="kw">sum</span>(count)<span class="op">/</span><span class="dv">10100</span> <span class="op">*</span><span class="dv">100</span>, </span>
<span id="cb1-17"><a href="#cb1-17"></a> <span class="dt">tertile =</span> <span class="dv">1</span>)</span>
<span id="cb1-18"><a href="#cb1-18"></a></span>
<span id="cb1-19"><a href="#cb1-19"></a>dat_tertile033 <-<span class="st"> </span>dat03 <span class="op">%>%</span><span class="st"> </span><span class="kw">filter</span>(tertile <span class="op">==</span><span class="st"> </span><span class="dv">3</span>) <span class="op">%>%</span></span>
<span id="cb1-20"><a href="#cb1-20"></a><span class="st"> </span><span class="kw">pivot_longer</span>(<span class="dt">cols =</span> <span class="kw">starts_with</span>(<span class="st">"SC_"</span>), </span>
<span id="cb1-21"><a href="#cb1-21"></a> <span class="dt">names_to =</span> <span class="st">"income_bracket"</span>, </span>
<span id="cb1-22"><a href="#cb1-22"></a> <span class="dt">values_to =</span> <span class="st">"count"</span>) <span class="op">%>%</span></span>
<span id="cb1-23"><a href="#cb1-23"></a><span class="st"> </span><span class="kw">group_by</span>(income_bracket) <span class="op">%>%</span></span>
<span id="cb1-24"><a href="#cb1-24"></a><span class="st"> </span><span class="kw">summarise</span>(<span class="dt">perc =</span> <span class="kw">sum</span>(count)<span class="op">/</span><span class="dv">10000</span><span class="op">*</span><span class="dv">100</span>, </span>
<span id="cb1-25"><a href="#cb1-25"></a> <span class="dt">tertile =</span> <span class="dv">3</span>)</span>
<span id="cb1-26"><a href="#cb1-26"></a></span>
<span id="cb1-27"><a href="#cb1-27"></a>dat04 <-<span class="st"> </span>dat_tertile031 <span class="op">%>%</span><span class="st"> </span><span class="kw">mutate</span>(<span class="dt">tertile =</span> <span class="st">"Poorest Tertile of Participants"</span>) <span class="op">%>%</span></span>
<span id="cb1-28"><a href="#cb1-28"></a><span class="st"> </span><span class="kw">bind_rows</span>(dat_tertile033 <span class="op">%>%</span></span>
<span id="cb1-29"><a href="#cb1-29"></a><span class="st"> </span><span class="kw">mutate</span>(<span class="dt">tertile =</span> <span class="st">"Wealthiest Tertile of Participants"</span>)) <span class="op">%>%</span></span>
<span id="cb1-30"><a href="#cb1-30"></a><span class="st"> </span><span class="kw">mutate</span>(<span class="dt">income_bracket =</span> <span class="kw">recode</span>(income_bracket,</span>
<span id="cb1-31"><a href="#cb1-31"></a> <span class="st">"SC_15"</span> =<span class="st"> </span><span class="dv">1</span>, </span>
<span id="cb1-32"><a href="#cb1-32"></a> <span class="st">"SC_30"</span> =<span class="st"> </span><span class="dv">2</span>, </span>
<span id="cb1-33"><a href="#cb1-33"></a> <span class="st">"SC_45"</span> =<span class="st"> </span><span class="dv">3</span>, </span>
<span id="cb1-34"><a href="#cb1-34"></a> <span class="st">"SC_60"</span> =<span class="st"> </span><span class="dv">4</span>, </span>
<span id="cb1-35"><a href="#cb1-35"></a> <span class="st">"SC_75"</span> =<span class="st"> </span><span class="dv">5</span>, </span>
<span id="cb1-36"><a href="#cb1-36"></a> <span class="st">"SC_90"</span> =<span class="st"> </span><span class="dv">6</span>, </span>
<span id="cb1-37"><a href="#cb1-37"></a> <span class="st">"SC_105"</span> =<span class="st"> </span><span class="dv">7</span>, </span>
<span id="cb1-38"><a href="#cb1-38"></a> <span class="st">"SC_120"</span> =<span class="st"> </span><span class="dv">8</span>, </span>
<span id="cb1-39"><a href="#cb1-39"></a> <span class="st">"SC_135"</span> =<span class="st"> </span><span class="dv">9</span>, </span>
<span id="cb1-40"><a href="#cb1-40"></a> <span class="st">"SC_150"</span> =<span class="st"> </span><span class="dv">10</span>, </span>
<span id="cb1-41"><a href="#cb1-41"></a> <span class="st">"SC_150plus"</span> =<span class="st"> </span><span class="dv">11</span>))</span>
<span id="cb1-42"><a href="#cb1-42"></a></span>
<span id="cb1-43"><a href="#cb1-43"></a>linegraph <-<span class="st"> </span><span class="kw">ggplot</span>(dat04, </span>
<span id="cb1-44"><a href="#cb1-44"></a> <span class="kw">aes</span>(<span class="dt">y =</span> perc, <span class="dt">x =</span> income_bracket, </span>
<span id="cb1-45"><a href="#cb1-45"></a> <span class="dt">color =</span> tertile)) <span class="op">+</span><span class="st"> </span></span>
<span id="cb1-46"><a href="#cb1-46"></a><span class="st"> </span><span class="kw">geom_line</span>(<span class="dt">show.legend =</span> <span class="ot">TRUE</span>, <span class="dt">size =</span> <span class="fl">1.2</span>, <span class="kw">aes</span>(<span class="dt">linetype=</span> tertile)) <span class="op">+</span></span>
<span id="cb1-47"><a href="#cb1-47"></a><span class="st"> </span><span class="kw">scale_color_manual</span>(<span class="dt">values=</span><span class="kw">c</span>(<span class="st">"#FFA500"</span>,<span class="st">"#008080"</span>)) <span class="op">+</span></span>
<span id="cb1-48"><a href="#cb1-48"></a><span class="st"> </span><span class="kw">scale_linetype_manual</span>(<span class="dt">values =</span> <span class="kw">c</span>(<span class="st">"solid"</span>, <span class="st">"dotted"</span>)) <span class="op">+</span></span>
<span id="cb1-49"><a href="#cb1-49"></a><span class="st"> </span><span class="kw">ggtitle</span>(<span class="st">"1a. Participants' Estimates of Income Distribution of Their Social Circles"</span>) <span class="op">+</span></span>
<span id="cb1-50"><a href="#cb1-50"></a><span class="st"> </span><span class="kw">scale_x_continuous</span>(<span class="dt">name =</span> <span class="st">"Income ('000 USD)"</span>,</span>
<span id="cb1-51"><a href="#cb1-51"></a> <span class="dt">breaks =</span> <span class="kw">c</span>(<span class="dv">1</span>,<span class="dv">2</span>,<span class="dv">3</span>,<span class="dv">4</span>,<span class="dv">5</span>,<span class="dv">6</span>,<span class="dv">7</span>,<span class="dv">8</span>,<span class="dv">9</span>,<span class="dv">10</span>,<span class="dv">11</span>),</span>
<span id="cb1-52"><a href="#cb1-52"></a> <span class="dt">labels =</span> <span class="kw">c</span>(<span class="st">"0-15"</span>,<span class="st">"15-30"</span>, <span class="st">"30-45"</span>, <span class="st">"45-60"</span>, <span class="st">"60-75"</span>, </span>
<span id="cb1-53"><a href="#cb1-53"></a> <span class="st">"75-90"</span>, <span class="st">"90-105"</span>, <span class="st">"105-120"</span>, <span class="st">"120-135"</span>, <span class="st">"135-150"</span>, </span>
<span id="cb1-54"><a href="#cb1-54"></a> <span class="st">"150+"</span>), </span>
<span id="cb1-55"><a href="#cb1-55"></a> <span class="dt">expand =</span> <span class="kw">c</span>(<span class="dv">0</span>,<span class="dv">0</span>)) <span class="op">+</span></span>
<span id="cb1-56"><a href="#cb1-56"></a><span class="st"> </span><span class="kw">scale_y_continuous</span>(<span class="dt">name =</span> <span class="st">"Estimated Mean Percentage of People"</span>, </span>
<span id="cb1-57"><a href="#cb1-57"></a> <span class="dt">limits =</span> <span class="kw">c</span>(<span class="dv">0</span>, <span class="dv">30</span>), </span>
<span id="cb1-58"><a href="#cb1-58"></a> <span class="dt">expand =</span> <span class="kw">c</span>(<span class="dv">0</span>,<span class="dv">0</span>)) <span class="op">+</span></span>
<span id="cb1-59"><a href="#cb1-59"></a><span class="st"> </span></span>
<span id="cb1-60"><a href="#cb1-60"></a><span class="st"> </span><span class="kw">theme_classic</span>() <span class="op">+</span></span>
<span id="cb1-61"><a href="#cb1-61"></a><span class="st"> </span></span>
<span id="cb1-62"><a href="#cb1-62"></a><span class="st"> </span><span class="kw">theme</span>(<span class="dt">plot.title =</span> <span class="kw">element_text</span>(<span class="dt">hjust =</span> <span class="fl">0.5</span>, <span class="dt">face =</span> <span class="st">"bold"</span>, <span class="dt">size=</span><span class="dv">14</span>), </span>
<span id="cb1-63"><a href="#cb1-63"></a> <span class="dt">axis.text.x =</span> <span class="kw">element_text</span>(<span class="dt">angle =</span> <span class="dv">45</span>, <span class="dt">hjust=</span><span class="dv">1</span>, <span class="dt">size=</span><span class="dv">12</span>),</span>
<span id="cb1-64"><a href="#cb1-64"></a> <span class="dt">axis.text.y =</span> <span class="kw">element_text</span>(<span class="dt">size=</span><span class="dv">12</span>), </span>
<span id="cb1-65"><a href="#cb1-65"></a> <span class="dt">axis.title.x =</span> <span class="kw">element_text</span>(<span class="dt">size=</span><span class="dv">13</span>, <span class="dt">face =</span> <span class="st">"bold"</span>), </span>
<span id="cb1-66"><a href="#cb1-66"></a> <span class="dt">axis.title.y =</span> <span class="kw">element_text</span>(<span class="dt">size=</span><span class="dv">13</span>, <span class="dt">face =</span> <span class="st">"bold"</span>), </span>
<span id="cb1-67"><a href="#cb1-67"></a> <span class="dt">legend.title =</span> <span class="kw">element_blank</span>(), </span>
<span id="cb1-68"><a href="#cb1-68"></a> <span class="dt">legend.position=</span><span class="kw">c</span>(<span class="fl">0.8</span>, <span class="fl">0.8</span>))</span>
<span id="cb1-69"><a href="#cb1-69"></a></span>
<span id="cb1-70"><a href="#cb1-70"></a>linegraph</span></code></pre></div>
<p><img src="dataviz0003_files/figure-html/unnamed-chunk-1-1.png" /><!-- --></p>
</div>
<div id="since-we-have-some-extra-time-lets-build-a-bar-graph." class="section level2">
<h2>Since we have some extra time, let’s build a bar graph.</h2>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb2-1"><a href="#cb2-1"></a><span class="kw">ggplot</span>(dat04, <span class="kw">aes</span>(<span class="dt">fill=</span>tertile, <span class="dt">y =</span> perc, <span class="dt">x =</span> income_bracket)) <span class="op">+</span><span class="st"> </span></span>
<span id="cb2-2"><a href="#cb2-2"></a><span class="st"> </span><span class="kw">geom_bar</span>(<span class="dt">position=</span><span class="st">"dodge"</span>, <span class="dt">stat=</span><span class="st">"identity"</span>, </span>
<span id="cb2-3"><a href="#cb2-3"></a> <span class="dt">width=</span><span class="fl">0.7</span>) <span class="op">+</span><span class="st"> </span></span>
<span id="cb2-4"><a href="#cb2-4"></a><span class="st"> </span><span class="co">#scale_fill_manual(values = c("#FFA500","#008080")) +</span></span>
<span id="cb2-5"><a href="#cb2-5"></a><span class="st"> </span><span class="kw">ggtitle</span>(<span class="st">"1a. Bar Chart Alternative"</span>) <span class="op">+</span></span>
<span id="cb2-6"><a href="#cb2-6"></a><span class="st"> </span><span class="kw">scale_color_manual</span>(<span class="dt">values=</span><span class="kw">c</span>(<span class="st">"#FFA500"</span>,<span class="st">"#008080"</span>)) <span class="op">+</span></span>
<span id="cb2-7"><a href="#cb2-7"></a><span class="st"> </span><span class="kw">scale_x_continuous</span>(<span class="dt">name =</span> <span class="st">"Income ('000 USD)"</span>,</span>
<span id="cb2-8"><a href="#cb2-8"></a> <span class="dt">breaks =</span> <span class="kw">c</span>(<span class="dv">1</span>,<span class="dv">2</span>,<span class="dv">3</span>,<span class="dv">4</span>,<span class="dv">5</span>,<span class="dv">6</span>,<span class="dv">7</span>,<span class="dv">8</span>,<span class="dv">9</span>,<span class="dv">10</span>,<span class="dv">11</span>),</span>
<span id="cb2-9"><a href="#cb2-9"></a> <span class="dt">labels =</span> <span class="kw">c</span>(<span class="st">"0-15"</span>,<span class="st">"15-30"</span>, <span class="st">"30-45"</span>, <span class="st">"45-60"</span>, <span class="st">"60-75"</span>, </span>
<span id="cb2-10"><a href="#cb2-10"></a> <span class="st">"75-90"</span>, <span class="st">"90-105"</span>, <span class="st">"105-120"</span>, <span class="st">"120-135"</span>, <span class="st">"135-150"</span>, </span>
<span id="cb2-11"><a href="#cb2-11"></a> <span class="st">"150+"</span>), </span>
<span id="cb2-12"><a href="#cb2-12"></a> <span class="dt">expand =</span> <span class="kw">c</span>(<span class="dv">0</span>,<span class="dv">0</span>)) <span class="op">+</span></span>
<span id="cb2-13"><a href="#cb2-13"></a><span class="st"> </span><span class="kw">scale_y_continuous</span>(<span class="dt">name=</span><span class="st">"Percentage of total households"</span>, </span>
<span id="cb2-14"><a href="#cb2-14"></a> <span class="dt">limits =</span> <span class="kw">c</span>(<span class="dv">0</span>, <span class="dv">30</span>), </span>
<span id="cb2-15"><a href="#cb2-15"></a> <span class="dt">expand =</span> <span class="kw">c</span>(<span class="dv">0</span>,<span class="dv">0</span>)) <span class="op">+</span></span>
<span id="cb2-16"><a href="#cb2-16"></a></span>
<span id="cb2-17"><a href="#cb2-17"></a><span class="st"> </span><span class="kw">theme_classic</span>() <span class="op">+</span></span>
<span id="cb2-18"><a href="#cb2-18"></a><span class="st"> </span><span class="kw">theme</span>(<span class="dt">plot.title =</span> <span class="kw">element_text</span>(<span class="dt">hjust =</span> <span class="fl">0.5</span>, <span class="dt">face =</span> <span class="st">"bold"</span>, <span class="dt">size=</span><span class="dv">14</span>), </span>
<span id="cb2-19"><a href="#cb2-19"></a> <span class="dt">axis.text.x =</span> <span class="kw">element_text</span>(<span class="dt">angle =</span> <span class="dv">45</span>, <span class="dt">hjust=</span><span class="dv">1</span>, <span class="dt">size=</span><span class="dv">12</span>),</span>
<span id="cb2-20"><a href="#cb2-20"></a> <span class="dt">axis.text.y =</span> <span class="kw">element_text</span>(<span class="dt">size=</span><span class="dv">12</span>), </span>
<span id="cb2-21"><a href="#cb2-21"></a> <span class="dt">axis.title.x =</span> <span class="kw">element_text</span>(<span class="dt">size=</span><span class="dv">13</span>, <span class="dt">face =</span> <span class="st">"bold"</span>), </span>
<span id="cb2-22"><a href="#cb2-22"></a> <span class="dt">axis.title.y =</span> <span class="kw">element_text</span>(<span class="dt">size=</span><span class="dv">13</span>, <span class="dt">face =</span> <span class="st">"bold"</span>), </span>
<span id="cb2-23"><a href="#cb2-23"></a> <span class="dt">legend.title =</span> <span class="kw">element_blank</span>(), </span>
<span id="cb2-24"><a href="#cb2-24"></a> <span class="dt">legend.position=</span><span class="kw">c</span>(<span class="fl">0.8</span>, <span class="fl">0.8</span>))</span></code></pre></div>
<p><img src="dataviz0003_files/figure-html/unnamed-chunk-2-1.png" /><!-- --></p>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb3-1"><a href="#cb3-1"></a><span class="co"># Notes for #FUTURE: </span></span>
<span id="cb3-2"><a href="#cb3-2"></a><span class="co"># From tomorrow onwards, I'll write ggplot code in a more modularized way. </span></span>
<span id="cb3-3"><a href="#cb3-3"></a><span class="co"># None of this mess will be acceptable from here on. </span></span>
<span id="cb3-4"><a href="#cb3-4"></a></span>
<span id="cb3-5"><a href="#cb3-5"></a><span class="co"># R version 4.0.3</span></span>
<span id="cb3-6"><a href="#cb3-6"></a><span class="co"># ggplot2 version 3.3.2</span></span></code></pre></div>
</div>
</div>
</div>
<!-- code folding -->
<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
(function () {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
document.getElementsByTagName("head")[0].appendChild(script);
})();
</script>
</body>
</html>