620 lines
360 KiB
HTML
620 lines
360 KiB
HTML
|
<!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" />
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<title>Aesthetic specifications</title>
|
|||
|
|
|||
|
<script>// Pandoc 2.9 adds attributes on both header and div. We remove the former (to
|
|||
|
// be compatible with the behavior of Pandoc < 2.8).
|
|||
|
document.addEventListener('DOMContentLoaded', function(e) {
|
|||
|
var hs = document.querySelectorAll("div.section[class*='level'] > :first-child");
|
|||
|
var i, h, a;
|
|||
|
for (i = 0; i < hs.length; i++) {
|
|||
|
h = hs[i];
|
|||
|
if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6
|
|||
|
a = h.attributes;
|
|||
|
while (a.length > 0) h.removeAttribute(a[0].name);
|
|||
|
}
|
|||
|
});
|
|||
|
</script>
|
|||
|
|
|||
|
<style type="text/css">
|
|||
|
code{white-space: pre-wrap;}
|
|||
|
span.smallcaps{font-variant: small-caps;}
|
|||
|
span.underline{text-decoration: underline;}
|
|||
|
div.column{display: inline-block; vertical-align: top; width: 50%;}
|
|||
|
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
|
|||
|
ul.task-list{list-style: none;}
|
|||
|
</style>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<style type="text/css">
|
|||
|
code {
|
|||
|
white-space: pre;
|
|||
|
}
|
|||
|
.sourceCode {
|
|||
|
overflow: visible;
|
|||
|
}
|
|||
|
</style>
|
|||
|
<style type="text/css" data-origin="pandoc">
|
|||
|
pre > code.sourceCode { white-space: pre; position: relative; }
|
|||
|
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
|
|||
|
pre > code.sourceCode > span:empty { height: 1.2em; }
|
|||
|
.sourceCode { overflow: visible; }
|
|||
|
code.sourceCode > span { color: inherit; text-decoration: inherit; }
|
|||
|
div.sourceCode { margin: 1em 0; }
|
|||
|
pre.sourceCode { margin: 0; }
|
|||
|
@media screen {
|
|||
|
div.sourceCode { overflow: auto; }
|
|||
|
}
|
|||
|
@media print {
|
|||
|
pre > code.sourceCode { white-space: pre-wrap; }
|
|||
|
pre > 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 {
|
|||
|
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
|
|||
|
}
|
|||
|
code span.al { color: #ff0000; font-weight: bold; }
|
|||
|
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; }
|
|||
|
code span.at { color: #7d9029; }
|
|||
|
code span.bn { color: #40a070; }
|
|||
|
code span.bu { color: #008000; }
|
|||
|
code span.cf { color: #007020; font-weight: bold; }
|
|||
|
code span.ch { color: #4070a0; }
|
|||
|
code span.cn { color: #880000; }
|
|||
|
code span.co { color: #60a0b0; font-style: italic; }
|
|||
|
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; }
|
|||
|
code span.do { color: #ba2121; font-style: italic; }
|
|||
|
code span.dt { color: #902000; }
|
|||
|
code span.dv { color: #40a070; }
|
|||
|
code span.er { color: #ff0000; font-weight: bold; }
|
|||
|
code span.ex { }
|
|||
|
code span.fl { color: #40a070; }
|
|||
|
code span.fu { color: #06287e; }
|
|||
|
code span.im { color: #008000; font-weight: bold; }
|
|||
|
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; }
|
|||
|
code span.kw { color: #007020; font-weight: bold; }
|
|||
|
code span.op { color: #666666; }
|
|||
|
code span.ot { color: #007020; }
|
|||
|
code span.pp { color: #bc7a00; }
|
|||
|
code span.sc { color: #4070a0; }
|
|||
|
code span.ss { color: #bb6688; }
|
|||
|
code span.st { color: #4070a0; }
|
|||
|
code span.va { color: #19177c; }
|
|||
|
code span.vs { color: #4070a0; }
|
|||
|
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; }
|
|||
|
</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; }
|
|||
|
var j = 0;
|
|||
|
while (j < rules.length) {
|
|||
|
var rule = rules[j];
|
|||
|
// check if there is a div.sourceCode rule
|
|||
|
if (rule.type !== rule.STYLE_RULE || rule.selectorText !== "div.sourceCode") {
|
|||
|
j++;
|
|||
|
continue;
|
|||
|
}
|
|||
|
var style = rule.style.cssText;
|
|||
|
// check if color or background-color is set
|
|||
|
if (rule.style.color === '' && rule.style.backgroundColor === '') {
|
|||
|
j++;
|
|||
|
continue;
|
|||
|
}
|
|||
|
// replace div.sourceCode by a pre.sourceCode rule
|
|||
|
sheets[i].deleteRule(j);
|
|||
|
sheets[i].insertRule('pre.sourceCode{' + style + '}', j);
|
|||
|
}
|
|||
|
}
|
|||
|
})();
|
|||
|
</script>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<style type="text/css">body {
|
|||
|
background-color: #fff;
|
|||
|
margin: 1em auto;
|
|||
|
max-width: 700px;
|
|||
|
overflow: visible;
|
|||
|
padding-left: 2em;
|
|||
|
padding-right: 2em;
|
|||
|
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|||
|
font-size: 14px;
|
|||
|
line-height: 1.35;
|
|||
|
}
|
|||
|
#TOC {
|
|||
|
clear: both;
|
|||
|
margin: 0 0 10px 10px;
|
|||
|
padding: 4px;
|
|||
|
width: 400px;
|
|||
|
border: 1px solid #CCCCCC;
|
|||
|
border-radius: 5px;
|
|||
|
background-color: #f6f6f6;
|
|||
|
font-size: 13px;
|
|||
|
line-height: 1.3;
|
|||
|
}
|
|||
|
#TOC .toctitle {
|
|||
|
font-weight: bold;
|
|||
|
font-size: 15px;
|
|||
|
margin-left: 5px;
|
|||
|
}
|
|||
|
#TOC ul {
|
|||
|
padding-left: 40px;
|
|||
|
margin-left: -1.5em;
|
|||
|
margin-top: 5px;
|
|||
|
margin-bottom: 5px;
|
|||
|
}
|
|||
|
#TOC ul ul {
|
|||
|
margin-left: -2em;
|
|||
|
}
|
|||
|
#TOC li {
|
|||
|
line-height: 16px;
|
|||
|
}
|
|||
|
table {
|
|||
|
margin: 1em auto;
|
|||
|
border-width: 1px;
|
|||
|
border-color: #DDDDDD;
|
|||
|
border-style: outset;
|
|||
|
border-collapse: collapse;
|
|||
|
}
|
|||
|
table th {
|
|||
|
border-width: 2px;
|
|||
|
padding: 5px;
|
|||
|
border-style: inset;
|
|||
|
}
|
|||
|
table td {
|
|||
|
border-width: 1px;
|
|||
|
border-style: inset;
|
|||
|
line-height: 18px;
|
|||
|
padding: 5px 5px;
|
|||
|
}
|
|||
|
table, table th, table td {
|
|||
|
border-left-style: none;
|
|||
|
border-right-style: none;
|
|||
|
}
|
|||
|
table thead, table tr.even {
|
|||
|
background-color: #f7f7f7;
|
|||
|
}
|
|||
|
p {
|
|||
|
margin: 0.5em 0;
|
|||
|
}
|
|||
|
blockquote {
|
|||
|
background-color: #f6f6f6;
|
|||
|
padding: 0.25em 0.75em;
|
|||
|
}
|
|||
|
hr {
|
|||
|
border-style: solid;
|
|||
|
border: none;
|
|||
|
border-top: 1px solid #777;
|
|||
|
margin: 28px 0;
|
|||
|
}
|
|||
|
dl {
|
|||
|
margin-left: 0;
|
|||
|
}
|
|||
|
dl dd {
|
|||
|
margin-bottom: 13px;
|
|||
|
margin-left: 13px;
|
|||
|
}
|
|||
|
dl dt {
|
|||
|
font-weight: bold;
|
|||
|
}
|
|||
|
ul {
|
|||
|
margin-top: 0;
|
|||
|
}
|
|||
|
ul li {
|
|||
|
list-style: circle outside;
|
|||
|
}
|
|||
|
ul ul {
|
|||
|
margin-bottom: 0;
|
|||
|
}
|
|||
|
pre, code {
|
|||
|
background-color: #f7f7f7;
|
|||
|
border-radius: 3px;
|
|||
|
color: #333;
|
|||
|
white-space: pre-wrap;
|
|||
|
}
|
|||
|
pre {
|
|||
|
border-radius: 3px;
|
|||
|
margin: 5px 0px 10px 0px;
|
|||
|
padding: 10px;
|
|||
|
}
|
|||
|
pre:not([class]) {
|
|||
|
background-color: #f7f7f7;
|
|||
|
}
|
|||
|
code {
|
|||
|
font-family: Consolas, Monaco, 'Courier New', monospace;
|
|||
|
font-size: 85%;
|
|||
|
}
|
|||
|
p > code, li > code {
|
|||
|
padding: 2px 0px;
|
|||
|
}
|
|||
|
div.figure {
|
|||
|
text-align: center;
|
|||
|
}
|
|||
|
img {
|
|||
|
background-color: #FFFFFF;
|
|||
|
padding: 2px;
|
|||
|
border: 1px solid #DDDDDD;
|
|||
|
border-radius: 3px;
|
|||
|
border: 1px solid #CCCCCC;
|
|||
|
margin: 0 5px;
|
|||
|
}
|
|||
|
h1 {
|
|||
|
margin-top: 0;
|
|||
|
font-size: 35px;
|
|||
|
line-height: 40px;
|
|||
|
}
|
|||
|
h2 {
|
|||
|
border-bottom: 4px solid #f7f7f7;
|
|||
|
padding-top: 10px;
|
|||
|
padding-bottom: 2px;
|
|||
|
font-size: 145%;
|
|||
|
}
|
|||
|
h3 {
|
|||
|
border-bottom: 2px solid #f7f7f7;
|
|||
|
padding-top: 10px;
|
|||
|
font-size: 120%;
|
|||
|
}
|
|||
|
h4 {
|
|||
|
border-bottom: 1px solid #f7f7f7;
|
|||
|
margin-left: 8px;
|
|||
|
font-size: 105%;
|
|||
|
}
|
|||
|
h5, h6 {
|
|||
|
border-bottom: 1px solid #ccc;
|
|||
|
font-size: 105%;
|
|||
|
}
|
|||
|
a {
|
|||
|
color: #0033dd;
|
|||
|
text-decoration: none;
|
|||
|
}
|
|||
|
a:hover {
|
|||
|
color: #6666ff; }
|
|||
|
a:visited {
|
|||
|
color: #800080; }
|
|||
|
a:visited:hover {
|
|||
|
color: #BB00BB; }
|
|||
|
a[href^="http:"] {
|
|||
|
text-decoration: underline; }
|
|||
|
a[href^="https:"] {
|
|||
|
text-decoration: underline; }
|
|||
|
|
|||
|
code > span.kw { color: #555; font-weight: bold; }
|
|||
|
code > span.dt { color: #902000; }
|
|||
|
code > span.dv { color: #40a070; }
|
|||
|
code > span.bn { color: #d14; }
|
|||
|
code > span.fl { color: #d14; }
|
|||
|
code > span.ch { color: #d14; }
|
|||
|
code > span.st { color: #d14; }
|
|||
|
code > span.co { color: #888888; font-style: italic; }
|
|||
|
code > span.ot { color: #007020; }
|
|||
|
code > span.al { color: #ff0000; font-weight: bold; }
|
|||
|
code > span.fu { color: #900; font-weight: bold; }
|
|||
|
code > span.er { color: #a61717; background-color: #e3d2d2; }
|
|||
|
</style>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
</head>
|
|||
|
|
|||
|
<body>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<h1 class="title toc-ignore">Aesthetic specifications</h1>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<p>This vignette summarises the various formats that grid drawing
|
|||
|
functions take. Most of this information is available scattered
|
|||
|
throughout the R documentation. This appendix brings it all together in
|
|||
|
one place.</p>
|
|||
|
<div id="colour-and-fill" class="section level2">
|
|||
|
<h2>Colour and fill</h2>
|
|||
|
<p>Almost every geom has either colour, fill, or both. Colours and fills
|
|||
|
can be specified in the following ways:</p>
|
|||
|
<ul>
|
|||
|
<li><p>A <strong>name</strong>, e.g., <code>"red"</code>. R has 657
|
|||
|
built-in named colours, which can be listed with
|
|||
|
<code>colours()</code>.</p></li>
|
|||
|
<li><p>An <strong>rgb specification</strong>, with a string of the form
|
|||
|
<code>"#RRGGBB"</code> where each of the pairs <code>RR</code>,
|
|||
|
<code>GG</code>, <code>BB</code> consists of two hexadecimal digits
|
|||
|
giving a value in the range <code>00</code> to <code>FF</code></p>
|
|||
|
<p>You can optionally make the colour transparent by using the form
|
|||
|
<code>"#RRGGBBAA"</code>.</p></li>
|
|||
|
<li><p>An <strong>NA</strong>, for a completely transparent
|
|||
|
colour.</p></li>
|
|||
|
<li><p>The <a href="https://github.com/cwickham/munsell">munsell</a>
|
|||
|
package, by Charlotte Wickham, makes it easy to choose specific colours
|
|||
|
using a system designed by Albert H. Munsell. If you invest a little in
|
|||
|
learning the system, it provides a convenient way of specifying
|
|||
|
aesthetically pleasing colours.</p>
|
|||
|
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1" tabindex="-1"></a>munsell<span class="sc">::</span><span class="fu">mnsl</span>(<span class="st">"5PB 5/10"</span>)</span>
|
|||
|
<span id="cb1-2"><a href="#cb1-2" tabindex="-1"></a><span class="co">#> [1] "#447DBF"</span></span></code></pre></div></li>
|
|||
|
</ul>
|
|||
|
</div>
|
|||
|
<div id="lines" class="section level2">
|
|||
|
<h2>Lines</h2>
|
|||
|
<p>As well as <code>colour</code>, the appearance of a line is affected
|
|||
|
by <code>linewidth</code>, <code>linetype</code>, <code>linejoin</code>
|
|||
|
and <code>lineend</code>.</p>
|
|||
|
<div id="sec:line-type-spec" class="section level3">
|
|||
|
<h3>Line type</h3>
|
|||
|
<p>Line types can be specified with:</p>
|
|||
|
<ul>
|
|||
|
<li><p>An <strong>integer</strong> or <strong>name</strong>: 0 = blank,
|
|||
|
1 = solid, 2 = dashed, 3 = dotted, 4 = dotdash, 5 = longdash, 6 =
|
|||
|
twodash, as shown below:</p>
|
|||
|
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb2-1"><a href="#cb2-1" tabindex="-1"></a>lty <span class="ot"><-</span> <span class="fu">c</span>(<span class="st">"solid"</span>, <span class="st">"dashed"</span>, <span class="st">"dotted"</span>, <span class="st">"dotdash"</span>, <span class="st">"longdash"</span>, <span class="st">"twodash"</span>)</span>
|
|||
|
<span id="cb2-2"><a href="#cb2-2" tabindex="-1"></a>linetypes <span class="ot"><-</span> <span class="fu">data.frame</span>(</span>
|
|||
|
<span id="cb2-3"><a href="#cb2-3" tabindex="-1"></a> <span class="at">y =</span> <span class="fu">seq_along</span>(lty),</span>
|
|||
|
<span id="cb2-4"><a href="#cb2-4" tabindex="-1"></a> <span class="at">lty =</span> lty</span>
|
|||
|
<span id="cb2-5"><a href="#cb2-5" tabindex="-1"></a>) </span>
|
|||
|
<span id="cb2-6"><a href="#cb2-6" tabindex="-1"></a><span class="fu">ggplot</span>(linetypes, <span class="fu">aes</span>(<span class="dv">0</span>, y)) <span class="sc">+</span> </span>
|
|||
|
<span id="cb2-7"><a href="#cb2-7" tabindex="-1"></a> <span class="fu">geom_segment</span>(<span class="fu">aes</span>(<span class="at">xend =</span> <span class="dv">5</span>, <span class="at">yend =</span> y, <span class="at">linetype =</span> lty)) <span class="sc">+</span> </span>
|
|||
|
<span id="cb2-8"><a href="#cb2-8" tabindex="-1"></a> <span class="fu">scale_linetype_identity</span>() <span class="sc">+</span> </span>
|
|||
|
<span id="cb2-9"><a href="#cb2-9" tabindex="-1"></a> <span class="fu">geom_text</span>(<span class="fu">aes</span>(<span class="at">label =</span> lty), <span class="at">hjust =</span> <span class="dv">0</span>, <span class="at">nudge_y =</span> <span class="fl">0.2</span>) <span class="sc">+</span></span>
|
|||
|
<span id="cb2-10"><a href="#cb2-10" tabindex="-1"></a> <span class="fu">scale_x_continuous</span>(<span class="cn">NULL</span>, <span class="at">breaks =</span> <span class="cn">NULL</span>) <span class="sc">+</span> </span>
|
|||
|
<span id="cb2-11"><a href="#cb2-11" tabindex="-1"></a> <span class="fu">scale_y_reverse</span>(<span class="cn">NULL</span>, <span class="at">breaks =</span> <span class="cn">NULL</span>)</span></code></pre></div>
|
|||
|
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASAAAAEgCAYAAAAUg66AAAAEDmlDQ1BrQ0dDb2xvclNwYWNlR2VuZXJpY1JHQgAAOI2NVV1oHFUUPpu5syskzoPUpqaSDv41lLRsUtGE2uj+ZbNt3CyTbLRBkMns3Z1pJjPj/KRpKT4UQRDBqOCT4P9bwSchaqvtiy2itFCiBIMo+ND6R6HSFwnruTOzu5O4a73L3PnmnO9+595z7t4LkLgsW5beJQIsGq4t5dPis8fmxMQ6dMF90A190C0rjpUqlSYBG+PCv9rt7yDG3tf2t/f/Z+uuUEcBiN2F2Kw4yiLiZQD+FcWyXYAEQfvICddi+AnEO2ycIOISw7UAVxieD/Cyz5mRMohfRSwoqoz+xNuIB+cj9loEB3Pw2448NaitKSLLRck2q5pOI9O9g/t/tkXda8Tbg0+PszB9FN8DuPaXKnKW4YcQn1Xk3HSIry5ps8UQ/2W5aQnxIwBdu7yFcgrxPsRjVXu8HOh0qao30cArp9SZZxDfg3h1wTzKxu5E/LUxX5wKdX5SnAzmDx4A4OIqLbB69yMesE1pKojLjVdoNsfyiPi45hZmAn3uLWdpOtfQOaVmikEs7ovj8hFWpz7EV6mel0L9Xy23FMYlPYZenAx0yDB1/PX6dledmQjikjkXCxqMJS9WtfFCyH9XtSekEF+2dH+P4tzITduTygGfv58a5VCTH5PtXD7EFZiNyUDBhHnsFTBgE0SQIA9pfFtgo6cKGuhooeilaKH41eDs38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RKBp06Zy7949dUInTpxQ
|
|||
|
<li><p>The lengths of on/off stretches of line. This is done with a
|
|||
|
string containing 2, 4, 6, or 8 hexadecimal digits which give the
|
|||
|
lengths of consecutive lengths. For example, the string
|
|||
|
<code>"33"</code> specifies three units on followed by three off and
|
|||
|
<code>"3313"</code> specifies three units on followed by three off
|
|||
|
followed by one on and finally three off.</p>
|
|||
|
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb3-1"><a href="#cb3-1" tabindex="-1"></a>lty <span class="ot"><-</span> <span class="fu">c</span>(<span class="st">"11"</span>, <span class="st">"18"</span>, <span class="st">"1f"</span>, <span class="st">"81"</span>, <span class="st">"88"</span>, <span class="st">"8f"</span>, <span class="st">"f1"</span>, <span class="st">"f8"</span>, <span class="st">"ff"</span>)</span>
|
|||
|
<span id="cb3-2"><a href="#cb3-2" tabindex="-1"></a>linetypes <span class="ot"><-</span> <span class="fu">data.frame</span>(</span>
|
|||
|
<span id="cb3-3"><a href="#cb3-3" tabindex="-1"></a> <span class="at">y =</span> <span class="fu">seq_along</span>(lty),</span>
|
|||
|
<span id="cb3-4"><a href="#cb3-4" tabindex="-1"></a> <span class="at">lty =</span> lty</span>
|
|||
|
<span id="cb3-5"><a href="#cb3-5" tabindex="-1"></a>) </span>
|
|||
|
<span id="cb3-6"><a href="#cb3-6" tabindex="-1"></a><span class="fu">ggplot</span>(linetypes, <span class="fu">aes</span>(<span class="dv">0</span>, y)) <span class="sc">+</span> </span>
|
|||
|
<span id="cb3-7"><a href="#cb3-7" tabindex="-1"></a> <span class="fu">geom_segment</span>(<span class="fu">aes</span>(<span class="at">xend =</span> <span class="dv">5</span>, <span class="at">yend =</span> y, <span class="at">linetype =</span> lty)) <span class="sc">+</span> </span>
|
|||
|
<span id="cb3-8"><a href="#cb3-8" tabindex="-1"></a> <span class="fu">scale_linetype_identity</span>() <span class="sc">+</span> </span>
|
|||
|
<span id="cb3-9"><a href="#cb3-9" tabindex="-1"></a> <span class="fu">geom_text</span>(<span class="fu">aes</span>(<span class="at">label =</span> lty), <span class="at">hjust =</span> <span class="dv">0</span>, <span class="at">nudge_y =</span> <span class="fl">0.2</span>) <span class="sc">+</span></span>
|
|||
|
<span id="cb3-10"><a href="#cb3-10" tabindex="-1"></a> <span class="fu">scale_x_continuous</span>(<span class="cn">NULL</span>, <span class="at">breaks =</span> <span class="cn">NULL</span>) <span class="sc">+</span> </span>
|
|||
|
<span id="cb3-11"><a href="#cb3-11" tabindex="-1"></a> <span class="fu">scale_y_reverse</span>(<span class="cn">NULL</span>, <span class="at">breaks =</span> <span class="cn">NULL</span>)</span></code></pre></div>
|
|||
|
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASAAAAEgCAYAAAAUg66AAAAEDmlDQ1BrQ0dDb2xvclNwYWNlR2VuZXJpY1JHQgAAOI2NVV1oHFUUPpu5syskzoPUpqaSDv41lLRsUtGE2uj+ZbNt3CyTbLRBkMns3Z1pJjPj/KRpKT4UQRDBqOCT4P9bwSchaqvtiy2itFCiBIMo+ND6R6HSFwnruTOzu5O4a73L3PnmnO9+595z7t4LkLgsW5beJQIsGq4t5dPis8fmxMQ6dMF90A190C0rjpUqlSYBG+PCv9rt7yDG3tf2t/f/Z+uuUEcBiN2F2Kw4yiLiZQD+FcWyXYAEQfvICddi+AnEO2ycIOISw7UAVxieD/Cyz5mRMohfRSwoqoz+xNuIB+cj9loEB3Pw2448NaitKSLLRck2q5pOI9O9g/t/tkXda8Tbg0+PszB9FN8DuPaXKnKW4YcQn1Xk3HSIry5ps8UQ/2W5aQnxIwBdu7yFcgrxPsRjVXu8HOh0qao30cArp9SZZxDfg3h1wTzKxu5E/LUxX5wKdX5SnAzmDx4A4OIqLbB69yMesE1pKojLjVdoNsfyiPi45hZmAn3uLWdpOtfQOaVmikEs7ovj8hFWpz7EV6mel0L9Xy23FMYlPYZenAx0yDB1/PX6dledmQjikjkXCxqMJS9WtfFCyH9XtSekEF+2dH+P4tzITduTygGfv58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wIUICsqzCMBEnCEAAXIEcxshARIwIoABciKCvNIgAQcIUABcgQzGyEBErAiEFQBcu9zm52dfV/bJ0+eVPsX
|
|||
|
<p>The five standard dash-dot line types described above correspond to
|
|||
|
44, 13, 1343, 73, and 2262.</p></li>
|
|||
|
</ul>
|
|||
|
</div>
|
|||
|
<div id="linewidth" class="section level3">
|
|||
|
<h3>Linewidth</h3>
|
|||
|
<p>Due to a historical error, the unit of linewidth is roughly 0.75 mm.
|
|||
|
Making it exactly 1 mm would change a very large number of existing
|
|||
|
plots, so we’re stuck with this mistake.</p>
|
|||
|
</div>
|
|||
|
<div id="line-endjoin-paramters" class="section level3">
|
|||
|
<h3>Line end/join paramters</h3>
|
|||
|
<ul>
|
|||
|
<li><p>The appearance of the line end is controlled by the
|
|||
|
<code>lineend</code> paramter, and can be one of “round”, “butt” (the
|
|||
|
default), or “square”.</p>
|
|||
|
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb4-1"><a href="#cb4-1" tabindex="-1"></a>df <span class="ot"><-</span> <span class="fu">data.frame</span>(<span class="at">x =</span> <span class="dv">1</span><span class="sc">:</span><span class="dv">3</span>, <span class="at">y =</span> <span class="fu">c</span>(<span class="dv">4</span>, <span class="dv">1</span>, <span class="dv">9</span>))</span>
|
|||
|
<span id="cb4-2"><a href="#cb4-2" tabindex="-1"></a>base <span class="ot"><-</span> <span class="fu">ggplot</span>(df, <span class="fu">aes</span>(x, y)) <span class="sc">+</span> <span class="fu">xlim</span>(<span class="fl">0.5</span>, <span class="fl">3.5</span>) <span class="sc">+</span> <span class="fu">ylim</span>(<span class="dv">0</span>, <span class="dv">10</span>)</span>
|
|||
|
<span id="cb4-3"><a href="#cb4-3" tabindex="-1"></a>base <span class="sc">+</span> </span>
|
|||
|
<span id="cb4-4"><a href="#cb4-4" tabindex="-1"></a> <span class="fu">geom_path</span>(<span class="at">linewidth =</span> <span class="dv">10</span>) <span class="sc">+</span> </span>
|
|||
|
<span id="cb4-5"><a href="#cb4-5" tabindex="-1"></a> <span class="fu">geom_path</span>(<span class="at">linewidth =</span> <span class="dv">1</span>, <span class="at">colour =</span> <span class="st">"red"</span>)</span>
|
|||
|
<span id="cb4-6"><a href="#cb4-6" tabindex="-1"></a></span>
|
|||
|
<span id="cb4-7"><a href="#cb4-7" tabindex="-1"></a>base <span class="sc">+</span> </span>
|
|||
|
<span id="cb4-8"><a href="#cb4-8" tabindex="-1"></a> <span class="fu">geom_path</span>(<span class="at">linewidth =</span> <span class="dv">10</span>, <span class="at">lineend =</span> <span class="st">"round"</span>) <span class="sc">+</span> </span>
|
|||
|
<span id="cb4-9"><a href="#cb4-9" tabindex="-1"></a> <span class="fu">geom_path</span>(<span class="at">linewidth =</span> <span class="dv">1</span>, <span class="at">colour =</span> <span class="st">"red"</span>)</span>
|
|||
|
<span id="cb4-10"><a href="#cb4-10" tabindex="-1"></a></span>
|
|||
|
<span id="cb4-11"><a href="#cb4-11" tabindex="-1"></a>base <span class="sc">+</span> </span>
|
|||
|
<span id="cb4-12"><a href="#cb4-12" tabindex="-1"></a> <span class="fu">geom_path</span>(<span class="at">linewidth =</span> <span class="dv">10</span>, <span class="at">lineend =</span> <span class="st">"square"</span>) <span class="sc">+</span> </span>
|
|||
|
<span id="cb4-13"><a href="#cb4-13" tabindex="-1"></a> <span class="fu">geom_path</span>(<span class="at">linewidth =</span> <span class="dv">1</span>, <span class="at">colour =</span> <span class="st">"red"</span>)</span></code></pre></div>
|
|||
|
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASAAAAEgCAYAAAAUg66AAAAEDmlDQ1BrQ0dDb2xvclNwYWNlR2VuZXJpY1JHQgAAOI2NVV1oHFUUPpu5syskzoPUpqaSDv41lLRsUtGE2uj+ZbNt3CyTbLRBkMns3Z1pJjPj/KRpKT4UQRDBqOCT4P9bwSchaqvtiy2itFCiBIMo+ND6R6HSFwnruTOzu5O4a73L3PnmnO9+595z7t4LkLgsW5beJQIsGq4t5dPis8fmx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DAj89NNPRigqJ7pilPTBBx8QPIL+o0kzWvXMX+gM+w1PJxECSqfelLYEHoExY8Zo6djm+y1U76PhdKZYafrg6b6EaMLpIEJA6dCL0oZQIAC/5wiyqSoVKBfdTRe/qqfZW+XrkyZSo0aNqHXr1kZ5iLsXVhECCmvPid6hQ2DBggUEY7OqdDPJB/lG0Hm6YBawdu1a6tevnxGg4fnnnzcCPKiW7Xd6ISC/e0DqzxgEEhmfowGBOLmd6HLj1n/oPwYBRaaDr/RPPvnEiB5877330ujRo+nXX3+NTBbIz2m7CmZF1oyHupXGeo2XNpn37PXb3yezzlhlo344pQ+CHtDRbz0sHdzqgV3PkZGBY/WB/foDPPopwlMwyOdMQD/Zb0Z5jwjB+Hv55ZepTZs29NhjjyUlhBXwcIsJ1A9EVIwoOLq+5HRejHDI2Bjmt+TNm9eIDGKPFOuHTohCCwmCHoiq6bQfk4mVF88IIve+8cYbymrOoyuoiTkFe5R+p6lZEzBnRSGM1ZYtW6IG/HRWQvRU6JtE
|
|||
|
<li><p>The appearance of line joins is controlled by
|
|||
|
<code>linejoin</code> and can be one of “round” (the default), “mitre”,
|
|||
|
or “bevel”.</p>
|
|||
|
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb5-1"><a href="#cb5-1" tabindex="-1"></a>df <span class="ot"><-</span> <span class="fu">data.frame</span>(<span class="at">x =</span> <span class="dv">1</span><span class="sc">:</span><span class="dv">3</span>, <span class="at">y =</span> <span class="fu">c</span>(<span class="dv">9</span>, <span class="dv">1</span>, <span class="dv">9</span>))</span>
|
|||
|
<span id="cb5-2"><a href="#cb5-2" tabindex="-1"></a>base <span class="ot"><-</span> <span class="fu">ggplot</span>(df, <span class="fu">aes</span>(x, y)) <span class="sc">+</span> <span class="fu">ylim</span>(<span class="dv">0</span>, <span class="dv">10</span>)</span>
|
|||
|
<span id="cb5-3"><a href="#cb5-3" tabindex="-1"></a>base <span class="sc">+</span> </span>
|
|||
|
<span id="cb5-4"><a href="#cb5-4" tabindex="-1"></a> <span class="fu">geom_path</span>(<span class="at">linewidth =</span> <span class="dv">10</span>) <span class="sc">+</span> </span>
|
|||
|
<span id="cb5-5"><a href="#cb5-5" tabindex="-1"></a> <span class="fu">geom_path</span>(<span class="at">linewidth =</span> <span class="dv">1</span>, <span class="at">colour =</span> <span class="st">"red"</span>)</span>
|
|||
|
<span id="cb5-6"><a href="#cb5-6" tabindex="-1"></a></span>
|
|||
|
<span id="cb5-7"><a href="#cb5-7" tabindex="-1"></a>base <span class="sc">+</span> </span>
|
|||
|
<span id="cb5-8"><a href="#cb5-8" tabindex="-1"></a> <span class="fu">geom_path</span>(<span class="at">linewidth =</span> <span class="dv">10</span>, <span class="at">linejoin =</span> <span class="st">"mitre"</span>) <span class="sc">+</span> </span>
|
|||
|
<span id="cb5-9"><a href="#cb5-9" tabindex="-1"></a> <span class="fu">geom_path</span>(<span class="at">linewidth =</span> <span class="dv">1</span>, <span class="at">colour =</span> <span class="st">"red"</span>)</span>
|
|||
|
<span id="cb5-10"><a href="#cb5-10" tabindex="-1"></a></span>
|
|||
|
<span id="cb5-11"><a href="#cb5-11" tabindex="-1"></a>base <span class="sc">+</span> </span>
|
|||
|
<span id="cb5-12"><a href="#cb5-12" tabindex="-1"></a> <span class="fu">geom_path</span>(<span class="at">linewidth =</span> <span class="dv">10</span>, <span class="at">linejoin =</span> <span class="st">"bevel"</span>) <span class="sc">+</span> </span>
|
|||
|
<span id="cb5-13"><a href="#cb5-13" tabindex="-1"></a> <span class="fu">geom_path</span>(<span class="at">linewidth =</span> <span class="dv">1</span>, <span class="at">colour =</span> <span class="st">"red"</span>)</span></code></pre></div>
|
|||
|
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASAAAAEgCAYAAAAUg66AAAAEDmlDQ1BrQ0dDb2xvclNwYWNlR2VuZXJpY1JHQgAAOI2NVV1oHFUUPpu5syskzoPUpqaSDv41lLRsUtGE2uj+ZbNt3CyTbLRBkMns3Z1pJjPj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H23PPfd0r776qiNswxlnnFEgl502BNKBwJdffumFRGYURDTSrbfe2l177bXNwuQkeSWmgHKgy+78f/3rX16HjB8/vlkq4lo/99xzzY7ZD0MgjQice+65zULdQIV9yimnuJ133tmVI+yxKaAsdw3hPtiBz0gnM451kJwQs+FgasFx+zQE0oIAdp+bb745a3M5t/fee7vjjjvOsek0KTEFFEL2ww8/dEcddZTbZ5993FtvvRU60/IrHXT11Ve3PGFHDIGUIMBLtFBEwzvuuMObBVxxxRWJ0GGZApKb5eeff3YXX3yxI/DZvffeG/n2ueCCC8putIvcOEtoCORBAKaZqGYE7J5nnnmm23777T0WmzzFxj5V9wro+bPPdY913MSdd955sWM2M18+66yzYoNuGQyBSiJAzHDu97gC68yAXr3ctI6d3QfPlIYWq24VEASIU9tv7Dqffpb76zffu72dDgrogGDkMDEE0oLAqFGj1K4kF7rfum0/+MgttUV398Axx3mBBIu5bt1TV0yNFc4LM8WYMWNc9+7d3W1z3mtqzUgBtjDJSFPypi8sXw4ZMqQgP1JTBvtiCFQQgbfffttbZtc0obtbSF7UjZxg/3MN
|
|||
|
</ul>
|
|||
|
<p>Mitre joins are automatically converted to bevel joins whenever the
|
|||
|
angle is too small (which would create a very long bevel). This is
|
|||
|
controlled by the <code>linemitre</code> parameter which specifies the
|
|||
|
maximum ratio between the line width and the length of the mitre.</p>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div id="polygons" class="section level2">
|
|||
|
<h2>Polygons</h2>
|
|||
|
<p>The border of the polygon is controlled by the <code>colour</code>,
|
|||
|
<code>linetype</code>, and <code>linewidth</code> aesthetics as
|
|||
|
described above. The inside is controlled by <code>fill</code>.</p>
|
|||
|
</div>
|
|||
|
<div id="point" class="section level2">
|
|||
|
<h2>Point</h2>
|
|||
|
<div id="sec:shape-spec" class="section level3">
|
|||
|
<h3>Shape</h3>
|
|||
|
<p>Shapes take five types of values:</p>
|
|||
|
<ul>
|
|||
|
<li><p>An <strong>integer</strong> in <span class="math inline">\([0,
|
|||
|
25]\)</span>:</p>
|
|||
|
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb6-1"><a href="#cb6-1" tabindex="-1"></a>shapes <span class="ot"><-</span> <span class="fu">data.frame</span>(</span>
|
|||
|
<span id="cb6-2"><a href="#cb6-2" tabindex="-1"></a> <span class="at">shape =</span> <span class="fu">c</span>(<span class="dv">0</span><span class="sc">:</span><span class="dv">19</span>, <span class="dv">22</span>, <span class="dv">21</span>, <span class="dv">24</span>, <span class="dv">23</span>, <span class="dv">20</span>),</span>
|
|||
|
<span id="cb6-3"><a href="#cb6-3" tabindex="-1"></a> <span class="at">x =</span> <span class="dv">0</span><span class="sc">:</span><span class="dv">24</span> <span class="sc">%/%</span> <span class="dv">5</span>,</span>
|
|||
|
<span id="cb6-4"><a href="#cb6-4" tabindex="-1"></a> <span class="at">y =</span> <span class="sc">-</span>(<span class="dv">0</span><span class="sc">:</span><span class="dv">24</span> <span class="sc">%%</span> <span class="dv">5</span>)</span>
|
|||
|
<span id="cb6-5"><a href="#cb6-5" tabindex="-1"></a>)</span>
|
|||
|
<span id="cb6-6"><a href="#cb6-6" tabindex="-1"></a><span class="fu">ggplot</span>(shapes, <span class="fu">aes</span>(x, y)) <span class="sc">+</span> </span>
|
|||
|
<span id="cb6-7"><a href="#cb6-7" tabindex="-1"></a> <span class="fu">geom_point</span>(<span class="fu">aes</span>(<span class="at">shape =</span> shape), <span class="at">size =</span> <span class="dv">5</span>, <span class="at">fill =</span> <span class="st">"red"</span>) <span class="sc">+</span></span>
|
|||
|
<span id="cb6-8"><a href="#cb6-8" tabindex="-1"></a> <span class="fu">geom_text</span>(<span class="fu">aes</span>(<span class="at">label =</span> shape), <span class="at">hjust =</span> <span class="dv">0</span>, <span class="at">nudge_x =</span> <span class="fl">0.15</span>) <span class="sc">+</span></span>
|
|||
|
<span id="cb6-9"><a href="#cb6-9" tabindex="-1"></a> <span class="fu">scale_shape_identity</span>() <span class="sc">+</span></span>
|
|||
|
<span id="cb6-10"><a href="#cb6-10" tabindex="-1"></a> <span class="fu">expand_limits</span>(<span class="at">x =</span> <span class="fl">4.1</span>) <span class="sc">+</span></span>
|
|||
|
<span id="cb6-11"><a href="#cb6-11" tabindex="-1"></a> <span class="fu">theme_void</span>()</span></code></pre></div>
|
|||
|
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASAAAAEgCAYAAAAUg66AAAAEDmlDQ1BrQ0dDb2xvclNwYWNlR2VuZXJpY1JHQgAAOI2NVV1oHFUUPpu5syskzoPUpqaSDv41lLRsUtGE2uj+ZbNt3CyTbLRBkMns3Z1pJjPj/KRpKT4UQRDBqOCT4P9bwSchaqvtiy2itFCiBIMo+ND6R6HSFwnruTOzu5O4a73L3PnmnO9+595z7t4LkLgsW5beJQIsGq4t5dPis8fmxMQ6dMF90A190C0rjpUqlSYBG+PCv9rt7yDG3tf2t/f/Z+uuUEcBiN2F2Kw4yiLiZQD+FcWyXYAEQfvICddi+AnEO2ycIOISw7UAVxieD/Cyz5mRMohfRSwoqoz+xNuIB+cj9loEB3Pw2448NaitKSLLRck2q5pOI9O9g/t/tkXda8Tbg0+PszB9FN8DuPaXKnKW4YcQn1Xk3HSIry5ps8UQ/2W5aQnxIwBdu7yFcgrxPsRjVXu8HOh0qao30cArp9SZZxDfg3h1wTzKxu5E/LUxX5wKdX5SnAzmDx4A4OIqLbB69yMesE1pKojLjVdoNsfyiPi45hZmAn3uLWdpOtfQOaVmikEs7ovj8hFWpz7EV6mel0L9Xy23FMYlPYZenAx0yDB1/PX6dledmQjikjkXCxqMJS9WtfFCyH9XtSekEF+2dH+P4tzITduTygGfv58a5VCTH5PtXD7EFZiNyUDBhHnsFTBgE0SQIA9pfFtgo6cKGuhooeilaKH41eDs38Ip+f4At1Rq/sjr6NEwQqb/I/DQqsLvaFUjvAx+eWirddAJZnAj1DFJL0mSg/gcIpPkMBkhoyCSJ8lTZIxk0TpKDjXHliJzZPO50dR5ASNSnzeLvIvod0HG/mdkm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x6VKVOGSpcuHU1TmXIPtspQmSNNCEWALei3337z3dq7d29iDZDmzJnjy7NO8ByeiNSoUSOdBdtSt27djJwXVp8jOQaTHe0sX76c6tatG0mTCVEXW8vhw4freW91mImWtm/fTrwbop07d1K7du2oS5cuVjFbkTIwIWKYPUl+TwAJweVpUnrppZfSTT6WPJZNCHLDZQ1ig50DYQkgp1tvvdWqatyRt17E22U6evRoQN8wlqzNEXvAAsqQgQmG+2vWrKnL33rrLU2+69atC6iPttjD5pcPEuMtCLHHkeDWTuQUTHbIBZx4a0K8DaGffvpJk9HYsWOJPaqJLDa1bNlS/9mFmDZtGl122WVaXizGzz//vL044wgIExITtmjRon4PdK6UfoWZdPH2228T2yF0kGEsuoDVHXFUiJvBCtCpUydi2w+x/Yt4/0sdOnSIxWNi3sbhw4d1hDfbggLaxurFW2mC4dgtoQwxYFYKpvlt2rRJa0xWXRzZbqAvQULnnXeevSjhzoPJDuP+xo0bdQArFiTIC/K58soribftSRE/Zw3YmDFjaP78+fT9999bWX5HaMwZpgEhOAlBavCC2RNWuFDeFXv9eJzD3YzVCBMCnp30JLYl6O0E2oQ2YBFw8+bN9cuLQTGVgLBSQT1224bBDW+9LG74sL2H6tev71YUkAcNBwuUPVnzhGNq7NlJd465zzYSTTSIqkeqV68esQ2N4IHs379/Usj8xBNP0IgRI7S37/LLLw+QadGiRXo7lmE2ILjaS5UqRXC52ROusQ0zKcFWAbfgkiVLNAlF2zeLfBBHw4F6PvKx2mvdujVh9Tc1gSSxXYw0QTtau3Zt2HYN2Mbc5gW0INMWp0ixCFUf7wXkt8gH9dlRo7ekJs+NUHJZ5VYYCxba2bNn6xANq8w6zpo1S2/VYCvLMALCwy655BL64YcfrOfqI+KBsEUxLWHlTQ8J
|
|||
|
<li><p>The <strong>name</strong> of the shape:</p>
|
|||
|
<div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb7-1"><a href="#cb7-1" tabindex="-1"></a>shape_names <span class="ot"><-</span> <span class="fu">c</span>(</span>
|
|||
|
<span id="cb7-2"><a href="#cb7-2" tabindex="-1"></a> <span class="st">"circle"</span>, <span class="fu">paste</span>(<span class="st">"circle"</span>, <span class="fu">c</span>(<span class="st">"open"</span>, <span class="st">"filled"</span>, <span class="st">"cross"</span>, <span class="st">"plus"</span>, <span class="st">"small"</span>)), <span class="st">"bullet"</span>,</span>
|
|||
|
<span id="cb7-3"><a href="#cb7-3" tabindex="-1"></a> <span class="st">"square"</span>, <span class="fu">paste</span>(<span class="st">"square"</span>, <span class="fu">c</span>(<span class="st">"open"</span>, <span class="st">"filled"</span>, <span class="st">"cross"</span>, <span class="st">"plus"</span>, <span class="st">"triangle"</span>)),</span>
|
|||
|
<span id="cb7-4"><a href="#cb7-4" tabindex="-1"></a> <span class="st">"diamond"</span>, <span class="fu">paste</span>(<span class="st">"diamond"</span>, <span class="fu">c</span>(<span class="st">"open"</span>, <span class="st">"filled"</span>, <span class="st">"plus"</span>)),</span>
|
|||
|
<span id="cb7-5"><a href="#cb7-5" tabindex="-1"></a> <span class="st">"triangle"</span>, <span class="fu">paste</span>(<span class="st">"triangle"</span>, <span class="fu">c</span>(<span class="st">"open"</span>, <span class="st">"filled"</span>, <span class="st">"square"</span>)),</span>
|
|||
|
<span id="cb7-6"><a href="#cb7-6" tabindex="-1"></a> <span class="fu">paste</span>(<span class="st">"triangle down"</span>, <span class="fu">c</span>(<span class="st">"open"</span>, <span class="st">"filled"</span>)),</span>
|
|||
|
<span id="cb7-7"><a href="#cb7-7" tabindex="-1"></a> <span class="st">"plus"</span>, <span class="st">"cross"</span>, <span class="st">"asterisk"</span></span>
|
|||
|
<span id="cb7-8"><a href="#cb7-8" tabindex="-1"></a>)</span>
|
|||
|
<span id="cb7-9"><a href="#cb7-9" tabindex="-1"></a></span>
|
|||
|
<span id="cb7-10"><a href="#cb7-10" tabindex="-1"></a>shapes <span class="ot"><-</span> <span class="fu">data.frame</span>(</span>
|
|||
|
<span id="cb7-11"><a href="#cb7-11" tabindex="-1"></a> <span class="at">shape_names =</span> shape_names,</span>
|
|||
|
<span id="cb7-12"><a href="#cb7-12" tabindex="-1"></a> <span class="at">x =</span> <span class="fu">c</span>(<span class="dv">1</span><span class="sc">:</span><span class="dv">7</span>, <span class="dv">1</span><span class="sc">:</span><span class="dv">6</span>, <span class="dv">1</span><span class="sc">:</span><span class="dv">3</span>, <span class="dv">5</span>, <span class="dv">1</span><span class="sc">:</span><span class="dv">3</span>, <span class="dv">6</span>, <span class="dv">2</span><span class="sc">:</span><span class="dv">3</span>, <span class="dv">1</span><span class="sc">:</span><span class="dv">3</span>),</span>
|
|||
|
<span id="cb7-13"><a href="#cb7-13" tabindex="-1"></a> <span class="at">y =</span> <span class="sc">-</span><span class="fu">rep</span>(<span class="dv">1</span><span class="sc">:</span><span class="dv">6</span>, <span class="fu">c</span>(<span class="dv">7</span>, <span class="dv">6</span>, <span class="dv">4</span>, <span class="dv">4</span>, <span class="dv">2</span>, <span class="dv">3</span>))</span>
|
|||
|
<span id="cb7-14"><a href="#cb7-14" tabindex="-1"></a>)</span>
|
|||
|
<span id="cb7-15"><a href="#cb7-15" tabindex="-1"></a></span>
|
|||
|
<span id="cb7-16"><a href="#cb7-16" tabindex="-1"></a><span class="fu">ggplot</span>(shapes, <span class="fu">aes</span>(x, y)) <span class="sc">+</span></span>
|
|||
|
<span id="cb7-17"><a href="#cb7-17" tabindex="-1"></a> <span class="fu">geom_point</span>(<span class="fu">aes</span>(<span class="at">shape =</span> shape_names), <span class="at">fill =</span> <span class="st">"red"</span>, <span class="at">size =</span> <span class="dv">5</span>) <span class="sc">+</span></span>
|
|||
|
<span id="cb7-18"><a href="#cb7-18" tabindex="-1"></a> <span class="fu">geom_text</span>(<span class="fu">aes</span>(<span class="at">label =</span> shape_names), <span class="at">nudge_y =</span> <span class="sc">-</span><span class="fl">0.3</span>, <span class="at">size =</span> <span class="fl">3.5</span>) <span class="sc">+</span></span>
|
|||
|
<span id="cb7-19"><a href="#cb7-19" tabindex="-1"></a> <span class="fu">scale_shape_identity</span>() <span class="sc">+</span></span>
|
|||
|
<span id="cb7-20"><a href="#cb7-20" tabindex="-1"></a> <span class="fu">theme_void</span>()</span></code></pre></div>
|
|||
|
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAwAAAAEzCAYAAACG8GSkAAAEDmlDQ1BrQ0dDb2xvclNwYWNlR2VuZXJpY1JHQgAAOI2NVV1oHFUUPpu5syskzoPUpqaSDv41lLRsUtGE2uj+ZbNt3CyTbLRBkMns3Z1pJjPj/KRpKT4UQRDBqOCT4P9bwSchaqvtiy2itFCiBIMo+ND6R6HSFwnruTOzu5O4a73L3PnmnO9+595z7t4LkLgsW5beJQIsGq4t5dPis8fmxMQ6dMF90A190C0rjpUqlSYBG+PCv9rt7yDG3tf2t/f/Z+uuUEcBiN2F2Kw4yiLiZQD+FcWyXYAEQfvICddi+AnEO2ycIOISw7UAVxieD/Cyz5mRMohfRSwoqoz+xNuIB+cj9loEB3Pw2448NaitKSLLRck2q5pOI9O9g/t/tkXda8Tbg0+PszB9FN8DuPaXKnKW4YcQn1Xk3HSIry5ps8UQ/2W5aQnxIwBdu7yFcgrxPsRjVXu8HOh0qao30cArp9SZZxDfg3h1wTzKxu5E/LUxX5wKdX5SnAzmDx4A4OIqLbB69yMesE1pKojLjVdoNsfyiPi45hZmAn3uLWdpOtfQOaVmikEs7ovj8hFWpz7EV6mel0L9Xy23FMYlPYZenAx0yDB1/PX6dledmQjikjkXCxqMJS9WtfFCyH9XtSekEF+2dH+P4tzITduTygGfv58a5VCTH5PtXD7EFZiNyUDBhHnsFTBgE0SQIA9pfFtgo6cKGuhooeilaKH41eDs38Ip+f4At1Rq/sjr6NEwQqb/I/DQqsLvaFUjvAx+eWirddAJZnAj1DFJL0mSg/gcIpPkMBkhoyCSJ8lTZIxk0TpKDjXHliJzZPO50dR5ASNSnzeLvIvod0HG/mdkmOC0z8VKnzcQ2M/Yz2vKldduXjp9bleLu0ZWn7vWc+l0JGcaai10y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FQ2iDLOrlW57jajpZzzjmnhN/y/lGuCsDNN99sYNrjIIQ9At6rr75a3mz4vDQEdKKv2W677QyGm6O4u9W8pHPnzlGC0G85EWh/wAHmcamaMPdxQn7QcZ4qC1vXr2907kc5pZKPCUtg9OjRtmcR/p05kJ8S4IR/Z/YDk75HHnkk7GPor5wIoI7p/CpblsmPTKUAwJ/O6TA6Dys5CH/HgABGxqvriGtYecj5u+KKK2KQeiYhiMALL7yQtlz/85//BEWR03vlugzoww8/LMuWLdP3N5r7448/7MS1aKHoO9cE9OWWo48+WtSsJ9KjzjjjDHnttddEexgjhaPn3BLAxPzPdBLh8RKtWWgolWS/f4wt09ymkLFHJfDMM8+IKts2GFZYe+WVV+SBBx4QFfgTUd13331y//33y/jx40V7Fu11tS+XcePGJfzwJB4E0G6q+Y9dLS9KitS8RNQUzK62FyUc/eaewJgxY+Tvv/+O/CDIU2o6FDkcA5QPgRUrVoj28Kd9GBZl+Oqrr9L6y4WHaF/6MqRg6dKlgtntmbp33nkn06AMlyMCOqQs7dq1ixw7ViDByhQffvhh5LAMkDsC7777rhxSrbpUUYE+qmu3dJlMmTgxajD6zyEBrMyltsIlVg5JVgL8hH8kCauNIKx3dbYcJpVRhySAOnr44YeH9P0/b1WqVJFDDz1U0GbTxYvAW7rKWiYOq3xh6Ve6eBJAuYZpP6Eo5Kuzpdz2AcAa4uutt17GJYVRALp4EcDyga7HMGrKEA7h6eJDAOXRcFX0nijkYDNVGn7WpQjp4kMA+3BgbxVdVaREopwS0KJFC3t9+vTppeoxwqC9xtKh9evXLxGeP/JHQFdRs2v9P/nkk6USgRFVLAd65JFHlrqHC7p6
|
|||
|
<li><p>A <strong>single character</strong>, to use that character as a
|
|||
|
plotting symbol.</p></li>
|
|||
|
<li><p>A <code>.</code> to draw the smallest rectangle that is visible,
|
|||
|
usually 1 pixel.</p></li>
|
|||
|
<li><p>An <code>NA</code>, to draw nothing.</p></li>
|
|||
|
</ul>
|
|||
|
</div>
|
|||
|
<div id="colour-and-fill-1" class="section level3">
|
|||
|
<h3>Colour and fill</h3>
|
|||
|
<p>Note that shapes 21-24 have both stroke <code>colour</code> and a
|
|||
|
<code>fill</code>. The size of the filled part is controlled by
|
|||
|
<code>size</code>, the size of the stroke is controlled by
|
|||
|
<code>stroke</code>. Each is measured in mm, and the total size of the
|
|||
|
point is the sum of the two. Note that the size is constant along the
|
|||
|
diagonal in the following figure.</p>
|
|||
|
<div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb8-1"><a href="#cb8-1" tabindex="-1"></a>sizes <span class="ot"><-</span> <span class="fu">expand.grid</span>(<span class="at">size =</span> (<span class="dv">0</span><span class="sc">:</span><span class="dv">3</span>) <span class="sc">*</span> <span class="dv">2</span>, <span class="at">stroke =</span> (<span class="dv">0</span><span class="sc">:</span><span class="dv">3</span>) <span class="sc">*</span> <span class="dv">2</span>)</span>
|
|||
|
<span id="cb8-2"><a href="#cb8-2" tabindex="-1"></a><span class="fu">ggplot</span>(sizes, <span class="fu">aes</span>(size, stroke, <span class="at">size =</span> size, <span class="at">stroke =</span> stroke)) <span class="sc">+</span> </span>
|
|||
|
<span id="cb8-3"><a href="#cb8-3" tabindex="-1"></a> <span class="fu">geom_abline</span>(<span class="at">slope =</span> <span class="sc">-</span><span class="dv">1</span>, <span class="at">intercept =</span> <span class="dv">6</span>, <span class="at">colour =</span> <span class="st">"white"</span>, <span class="at">linewidth =</span> <span class="dv">6</span>) <span class="sc">+</span> </span>
|
|||
|
<span id="cb8-4"><a href="#cb8-4" tabindex="-1"></a> <span class="fu">geom_point</span>(<span class="at">shape =</span> <span class="dv">21</span>, <span class="at">fill =</span> <span class="st">"red"</span>) <span class="sc">+</span></span>
|
|||
|
<span id="cb8-5"><a href="#cb8-5" tabindex="-1"></a> <span class="fu">scale_size_identity</span>()</span></code></pre></div>
|
|||
|
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASAAAAEgCAYAAAAUg66AAAAEDmlDQ1BrQ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J/H7oZpwILqM9Fl7iPeIk6iEYxUpwPE+duxE1+btLVEXbLli2Ok71VvGQFHbxk54owN7sg7q1btzoug18Bd+3a5SqrZi7qGythTNU7bWVOw8XKx9G1Q4cO0caNG6ly5cpSQVixYsWYdiaDBw/OTC9PnjyZ516eoGd1NqxbNftgg5EdDMh0iBs91m2iIWGWwij3ir8HiQt7jBctzvH8dNQlRw4xdeshTnimboaLdaJwsYCAEHYUWVuRq/gY6nuJF6zqgZWdFbvKP9bRbXu/0AExx8pHXcst4kMZvU1dsDhqJyBYpcLiFebfVatWpXHjxtEll1wirZSN5TJOEVarVs14y9NzWEljGYDbh+KmEGgwukjUTUM8O0ZDwpAD1OiUgICVjrogXfyAlRfiZoYH+bmZ5XITFu1KkYYX9QI+WO6RSHt1i7EXn//TmJkPcYGPdgLCC4Ov9qBBg6h27doEC94bbrhBLpUwfimM+hnojDBr5bWcc8458quLh4lhntUwMJG8dS7FcLO0ZBodpwFi6HWWgYiWiS+580Ecyca/d+/eROCIGVfHUgx8XJzqDtfbrGUyFnqDi7D42MLmxivBO5LoUgy3M4M7ROErJliBnZnxrdeMefP5ycws+0mRIkXkRdWrwQuENTNWugUQhQ5RZcCXF4tV0WDDJhdeeKHjIoNo2tFRMaV8go6Il2i2IKQO4m834iY/N+nqCFuiRAnHyb4vMDnhgFgQBmGd
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div id="text" class="section level2">
|
|||
|
<h2>Text</h2>
|
|||
|
<div id="font-family" class="section level3">
|
|||
|
<h3>Font family</h3>
|
|||
|
<p>There are only three fonts that are guaranteed to work everywhere:
|
|||
|
“sans” (the default), “serif”, or “mono”:</p>
|
|||
|
<div class="sourceCode" id="cb9"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb9-1"><a href="#cb9-1" tabindex="-1"></a>df <span class="ot"><-</span> <span class="fu">data.frame</span>(<span class="at">x =</span> <span class="dv">1</span>, <span class="at">y =</span> <span class="dv">3</span><span class="sc">:</span><span class="dv">1</span>, <span class="at">family =</span> <span class="fu">c</span>(<span class="st">"sans"</span>, <span class="st">"serif"</span>, <span class="st">"mono"</span>))</span>
|
|||
|
<span id="cb9-2"><a href="#cb9-2" tabindex="-1"></a><span class="fu">ggplot</span>(df, <span class="fu">aes</span>(x, y)) <span class="sc">+</span> </span>
|
|||
|
<span id="cb9-3"><a href="#cb9-3" tabindex="-1"></a> <span class="fu">geom_text</span>(<span class="fu">aes</span>(<span class="at">label =</span> family, <span class="at">family =</span> family))</span></code></pre></div>
|
|||
|
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASAAAAEgCAYAAAAUg66AAAAEDmlDQ1BrQ0dDb2xvclNwYWNlR2VuZXJpY1JHQgAAOI2NVV1oHFUUPpu5syskzoPUpqaSDv41lLRsUtGE2uj+ZbNt3CyTbLRBkMns3Z1pJjPj/KRpKT4UQRDBqOCT4P9bwSchaqvtiy2itFCiBIMo+ND6R6HSFwnruTOzu5O4a73L3PnmnO9+595z7t4LkLgsW5beJQIsGq4t5dPis8fmxMQ6dMF90A190C0rjpUqlSYBG+PCv9rt7yDG3tf2t/f/Z+uuUEcBiN2F2Kw4yiLiZQD+FcWyXYAEQfvICddi+AnEO2ycIOISw7UAVxieD/Cyz5mRMohfRSwoqoz+xNuIB+cj9loEB3Pw2448NaitKSLLRck2q5pOI9O9g/t/tkXda8Tbg0+PszB9FN8DuPaXKnKW4YcQn1Xk3HSIry5ps8UQ/2W5aQnxIwBdu7yFcgrxPsRjVXu8HOh0qao30cArp9SZZxDfg3h1wTzKxu5E/LUxX5wKdX5SnAzmDx4A4OIqLbB69yMesE1pKojLjVdoNsfyiPi45hZmAn3uLWdpOtfQOaVmikEs7ovj8hFWpz7EV6mel0L9Xy23FMYlPYZenAx0yDB1/PX6dledmQjikjkXCxqMJS9WtfFCyH9XtSekEF+2dH+P4tzITduTygGfv58a5VCTH5PtXD7EFZiNyUDBhHnsFTBgE0SQIA9pfFtgo6cKGuhooeilaKH41eDs38Ip+f4At1R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STLuMmARJwJEABcsTDnSRAAjoJUIB00mXc
|
|||
|
<p>It’s trickier to include a system font on a plot because text drawing
|
|||
|
is done differently by each graphics device (GD). There are five GDs in
|
|||
|
common use (<code>png()</code>, <code>pdf()</code>, on screen devices
|
|||
|
for Windows, Mac and Linux), so to have a font work everywhere you need
|
|||
|
to configure five devices in five different ways. Two packages simplify
|
|||
|
the quandary a bit:</p>
|
|||
|
<ul>
|
|||
|
<li><p><code>showtext</code> makes GD-independent plots by rendering all
|
|||
|
text as polygons.</p></li>
|
|||
|
<li><p><code>extrafont</code> converts fonts to a standard format that
|
|||
|
all devices can use.</p></li>
|
|||
|
</ul>
|
|||
|
<p>Both approaches have pros and cons, so you will to need to try both
|
|||
|
of them and see which works best for your needs.</p>
|
|||
|
</div>
|
|||
|
<div id="font-face" class="section level3">
|
|||
|
<h3>Font face</h3>
|
|||
|
<div class="sourceCode" id="cb10"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb10-1"><a href="#cb10-1" tabindex="-1"></a>df <span class="ot"><-</span> <span class="fu">data.frame</span>(<span class="at">x =</span> <span class="dv">1</span><span class="sc">:</span><span class="dv">4</span>, <span class="at">fontface =</span> <span class="fu">c</span>(<span class="st">"plain"</span>, <span class="st">"bold"</span>, <span class="st">"italic"</span>, <span class="st">"bold.italic"</span>))</span>
|
|||
|
<span id="cb10-2"><a href="#cb10-2" tabindex="-1"></a><span class="fu">ggplot</span>(df, <span class="fu">aes</span>(<span class="dv">1</span>, x)) <span class="sc">+</span> </span>
|
|||
|
<span id="cb10-3"><a href="#cb10-3" tabindex="-1"></a> <span class="fu">geom_text</span>(<span class="fu">aes</span>(<span class="at">label =</span> fontface, <span class="at">fontface =</span> fontface))</span></code></pre></div>
|
|||
|
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASAAAAEgCAYAAAAUg66AAAAEDmlDQ1BrQ0dDb2xvclNwYWNlR2VuZXJpY1JHQgAAOI2NVV1oHFUUPpu5syskzoPUpqaSDv41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YnrDE83p70ahgCAGeHo6abhx8UTWT3snfH/99dfKDVo46Jqgi4ybEy2g5UYrB2NEaB2hW9SnTx91HhdAJH4wui/oBjVp0kSJEY7feuutgpkstFRKliwpLVq0kJMnT6rWCG52fPeqevXq6hjC42mM7wghDAQNhjiwDwHEV0OwjzqAPwgEuo1jxowRdAsRBgZfuAZphtWtW1fto2WTfn/GjBlq/6WXXlItN1wzf/58dQz/sG+3oYuKfJ07d85uV9fFj6EPN/zqbvl1Cfr/B2wfhIawoI+Pvj26VceOHVP9eVR0mjsEIO4oExhaFNowjQ2rXLmyEh9so7WRvkWor8PUNkQKXTA8XdHS0N0mtKR0qw6iCvHBPsJkNogLRAumB7F1i0i/GnDkyBG5++67ZdCgQcof0qcfTjqMbtHpAWgdB/aRToxhwfR4kNrhP9cJ2C5AGDyECGHwD3+Y1cCgIvrpNHcI6JsT3k+cOKEScejQoWDXBDepnn3CTJk2XIfWClpsaC1h9gvdJLRU8K5OqVKlVFC0prShKwbTYfRx/YmuE2bJqlWrFhyj0NPoWrDQdUKrdOjQoYLuGbp0GNTGU71ixYoqKp2nzAIEgYJAIp0Yg9HfREeL/OGHH1ZjTzot/HSegO1dMOezRI9ZEdA3
|
|||
|
</div>
|
|||
|
<div id="font-size" class="section level3">
|
|||
|
<h3>Font size</h3>
|
|||
|
<p>The <code>size</code> of text is measured in mm by default. This is
|
|||
|
unusual, but makes the size of text consistent with the size of lines
|
|||
|
and points. Typically you specify font size using points (or pt for
|
|||
|
short), where 1 pt = 0.35mm. In <code>geom_text()</code> and
|
|||
|
<code>geom_label()</code>, you can set <code>size.unit = "pt"</code> to
|
|||
|
use points instead of millimeters. In addition, ggplot2 provides a
|
|||
|
conversion factor as the variable <code>.pt</code>, so if you want to
|
|||
|
draw 12pt text, you can also set <code>size = 12 / .pt</code>.</p>
|
|||
|
</div>
|
|||
|
<div id="justification" class="section level3">
|
|||
|
<h3>Justification</h3>
|
|||
|
<p>Horizontal and vertical justification have the same parameterisation,
|
|||
|
either a string (“top”, “middle”, “bottom”, “left”, “center”, “right”)
|
|||
|
or a number between 0 and 1:</p>
|
|||
|
<ul>
|
|||
|
<li>top = 1, middle = 0.5, bottom = 0</li>
|
|||
|
<li>left = 0, center = 0.5, right = 1</li>
|
|||
|
</ul>
|
|||
|
<div class="sourceCode" id="cb11"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb11-1"><a href="#cb11-1" tabindex="-1"></a>just <span class="ot"><-</span> <span class="fu">expand.grid</span>(<span class="at">hjust =</span> <span class="fu">c</span>(<span class="dv">0</span>, <span class="fl">0.5</span>, <span class="dv">1</span>), <span class="at">vjust =</span> <span class="fu">c</span>(<span class="dv">0</span>, <span class="fl">0.5</span>, <span class="dv">1</span>))</span>
|
|||
|
<span id="cb11-2"><a href="#cb11-2" tabindex="-1"></a>just<span class="sc">$</span>label <span class="ot"><-</span> <span class="fu">paste0</span>(just<span class="sc">$</span>hjust, <span class="st">", "</span>, just<span class="sc">$</span>vjust)</span>
|
|||
|
<span id="cb11-3"><a href="#cb11-3" tabindex="-1"></a></span>
|
|||
|
<span id="cb11-4"><a href="#cb11-4" tabindex="-1"></a><span class="fu">ggplot</span>(just, <span class="fu">aes</span>(hjust, vjust)) <span class="sc">+</span></span>
|
|||
|
<span id="cb11-5"><a href="#cb11-5" tabindex="-1"></a> <span class="fu">geom_point</span>(<span class="at">colour =</span> <span class="st">"grey70"</span>, <span class="at">size =</span> <span class="dv">5</span>) <span class="sc">+</span> </span>
|
|||
|
<span id="cb11-6"><a href="#cb11-6" tabindex="-1"></a> <span class="fu">geom_text</span>(<span class="fu">aes</span>(<span class="at">label =</span> label, <span class="at">hjust =</span> hjust, <span class="at">vjust =</span> vjust))</span></code></pre></div>
|
|||
|
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASAAAAEgCAYAAAAUg66AAAAEDmlDQ1BrQ0dDb2xvclNwYWNlR2VuZXJpY1JHQgAAOI2NVV1oHFUUPpu5syskzoPUpqaSDv41lLRsUt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UO2///5q8uTJqk+fPqpVq1Z6HswqWhBC7ezQoYMe6bBhGYIRNMBklyhN/KBPNuuhbWLsD5PYdMbqlR+NGDFCYdPr1KmTNhgPHz5cC+YaNWrEo9m8weD5xBNP6E1t8QCxl2bNmnkKIGwUTt548cBO0343n2KE/YkEwpfOGPa00Y03mC4ef/xx9fe//123Q7v+Xu/2IMYqJaaPc845R89SvOIYd+Ki3cIbNHL2b3lRzgggGDR//vx4OTFQIgygKlWq6P0IxhO/2rVrm5++T+LSKP1UQexObdq0Ud26ddNpkTbGbuxOfh/S2RmzcofWgyZVt25d26vg3tFAHnzwQfXKK6+oY445RmNP46UR2wNF5cqV9WonA88PP/ygDj74YDVo0KBAeDHK2hozkYQHxaFjYO3fv7/W7Iv7JP5VqVIlvQiDNo8Waw8WiWLDG3avB6FIjNB+BcH4zEhGQ12wYIEeLdF+Xn/9ddW8eXMd9YQTTlBvvvmmDofhkqX4o446yi/ZuB+CzZbmcY//viCcKMPJJ58c9yI/hBwb5PzimgiMamhMF110kVZzjXuhPtnIyRQWnkJgeO6555ZYAUUAoRlCCKB69erp9yD/6CD2lFZ4UBI1FnPQvs1iTskQ3i5oUmwsxKyBEDPKgHeM//lg50Kz
|
|||
|
<p>Note that you can use numbers outside the range (0, 1), but it’s not
|
|||
|
recommended.</p>
|
|||
|
</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>
|