160 lines
127 KiB
HTML
Raw Normal View History

2025-01-12 00:52:51 +08:00
<!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">
<meta name="author" content="Baptiste Auguie" />
<meta name="date" content="2017-09-09" />
<title>Regular polygons and ellipses in grid graphics</title>
<style type="text/css">code{white-space: pre;}</style>
<style type="text/css">
div.sourceCode { overflow-x: auto; }
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
margin: 0; padding: 0; vertical-align: baseline; border: none; }
table.sourceCode { width: 100%; line-height: 100%; }
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
td.sourceCode { padding-left: 5px; }
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
code > span.dt { color: #902000; } /* DataType */
code > span.dv { color: #40a070; } /* DecVal */
code > span.bn { color: #40a070; } /* BaseN */
code > span.fl { color: #40a070; } /* Float */
code > span.ch { color: #4070a0; } /* Char */
code > span.st { color: #4070a0; } /* String */
code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
code > span.ot { color: #007020; } /* Other */
code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
code > span.fu { color: #06287e; } /* Function */
code > span.er { color: #ff0000; font-weight: bold; } /* Error */
code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
code > span.cn { color: #880000; } /* Constant */
code > span.sc { color: #4070a0; } /* SpecialChar */
code > span.vs { color: #4070a0; } /* VerbatimString */
code > span.ss { color: #bb6688; } /* SpecialString */
code > span.im { } /* Import */
code > span.va { color: #19177c; } /* Variable */
code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code > span.op { color: #666666; } /* Operator */
code > span.bu { } /* BuiltIn */
code > span.ex { } /* Extension */
code > span.pp { color: #bc7a00; } /* Preprocessor */
code > span.at { color: #7d9029; } /* Attribute */
code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
</style>
<link href="data:text/css;charset=utf-8,body%20%7B%0Abackground%2Dcolor%3A%20%23fff%3B%0Amargin%3A%201em%20auto%3B%0Amax%2Dwidth%3A%20800px%3B%0Aoverflow%3A%20visible%3B%0Apadding%2Dleft%3A%202em%3B%0Apadding%2Dright%3A%202em%3B%0Afont%2Dfamily%3A%20%22Helvetica%20Neue%22%2C%20Helvetica%2C%20Arial%2C%20sans%2Dserif%3B%0Afont%2Dsize%3A%2014px%3B%0Aline%2Dheight%3A%2020px%3B%0A%7D%0A%23header%20%7B%0Atext%2Dalign%3A%20center%3B%0A%7D%0A%23TOC%20%7B%0Aclear%3A%20both%3B%0Amargin%3A%200%200%2010px%200%3B%0Apadding%3A%204px%3B%0Aborder%3A%201px%20solid%20%23CCCCCC%3B%0Aborder%2Dradius%3A%205px%3B%0Abackground%2Dcolor%3A%20%23f6f6f6%3B%0Afont%2Dsize%3A%2013px%3B%0Aline%2Dheight%3A%201%2E3%3B%0A%7D%0A%23TOC%20%2Etoctitle%20%7B%0Afont%2Dweight%3A%20bold%3B%0Afont%2Dsize%3A%2015px%3B%0Amargin%2Dleft%3A%205px%3B%0A%7D%0A%23TOC%20ul%20%7B%0Apadding%2Dleft%3A%2040px%3B%0Amargin%2Dleft%3A%20%2D1%2E5em%3B%0Amargin%2Dtop%3A%205px%3B%0Amargin%2Dbottom%3A%205px%3B%0A%7D%0A%23TOC%20ul%20ul%20%7B%0Amargin%2Dleft%3A%20%2D2em%3B%0A%7D%0A%23TOC%20li%20%7B%0Aline%2Dheight%3A%2016px%3B%0A%7D%0Atable%3Anot%28%5Bclass%5D%29%20%7B%0Amargin%3A%20auto%3B%0Amin%2Dwidth%3A%2040%25%3B%0Aborder%2Dwidth%3A%201px%3B%0Aborder%2Dcolor%3A%20%23DDDDDD%3B%0Aborder%2Dstyle%3A%20outset%3B%0Aborder%2Dcollapse%3A%20collapse%3B%0A%7D%0Atable%5Bsummary%3D%22R%20argblock%22%5D%20%7B%0Awidth%3A%20100%25%3B%0Aborder%3A%20none%3B%0A%7D%0Atable%3Anot%28%5Bclass%5D%29%20th%20%7B%0Aborder%2Dwidth%3A%202px%3B%0Apadding%3A%205px%3B%0Aborder%2Dstyle%3A%20inset%3B%0A%7D%0Atable%3Anot%28%5Bclass%5D%29%20td%20%7B%0Aborder%2Dwidth%3A%201px%3B%0Aborder%2Dstyle%3A%20inset%3B%0Aline%2Dheight%3A%2018px%3B%0Apadding%3A%205px%205px%3B%0A%7D%0Atable%3Anot%28%5Bclass%5D%29%2C%20table%3Anot%28%5Bclass%5D%29%20th%2C%20table%3Anot%28%5Bclass%5D%29%20td%20%7B%0Aborder%2Dleft%2Dstyle%3A%20none%3B%0Aborder%2Dright%2Dstyle%3A%20none%3B%0A%7D%0Atable%3Anot%28%5Bclass%5D%29%20tr%2Eodd%20%7B%0Abackground%2Dcolor%3A%20%23f7f7f7%3B%0A%7D%0Ap%20%7B%0Amargin%3A%200%2E5em%200%3B%0A%7D%0Ablockquote%20%7B%0Abackground%2Dcolor%3A%20%23f6f6f6%3B%0Apadding%3A%2013px%3B%0Apadding%2Dbottom%3A%201px%3B%0A%7D%0Ahr%20%7B%0Aborder%2Dstyle%3A%20solid%3B%0Aborder%3A%20none%3B%0Aborder%2Dtop%3A%201px%20solid%20%23777%3B%0Amargin%3A%2028px%200%3B%0A%7D%0Adl%20%7B%0Amargin%2Dleft%3A%200%3B%0A%7D%0Adl%20dd%20%7B%0Amargin%2Dbottom%3A%2013px%3B%0Amargin%2Dleft%3A%2013px%3B%0A%7D%0Adl%20dt%20%7B%0Afont%2Dweight%3A%20bold%3B%0A%7D%0Aul%20%7B%0Amargin%2Dtop%3A%200%3B%0A%7D%0Aul%20li%20%7B%0Alist%2Dstyle%3A%20circle%20outside%3B%0A%7D%0Aul%20ul%20%7B%0Amargin%2Dbottom%3A%200%3B%0A%7D%0Apre%2C%20code%20%7B%0Abackground%2Dcolor%3A%20%23f5f5f5%3B%0Aborder%2Dradius%3A%203px%3B%0Acolor%3A%20%23333%3B%0A%7D%0Apre%20%7B%0Aoverflow%2Dx%3A%20auto%3B%0Aborder%2Dradius%3A%203px%3B%0Amargin%3A%205px%200%2010px%200%3B%0Apadding%3A%2010px%3B%0A%7D%0Apre%3Anot%28%5Bclass%5D%29%20%7B%0Abackground%2Dcolor%3A%20white%3B%0Aborder%3A%20%23f5f5f5%201px%20solid%3B%0A%7D%0Apre%3Anot%28%5Bclass%5D%29%20code%20%7B%0Acolor%3A%20%23444%3B%0Abackground%2Dcolor%3A%20white%3B%0A%7D%0Acode%20%7B%0Afont%2Dfamily%3A%20monospace%3B%0Afont%2Dsize%3A%2090%25%3B%0A%7D%0Ap%20%3E%20code%2C%20li%20%3E%20code%20%7B%0Apadding%3A%202px%204px%3B%0Acolor%3A%20%23d14%3B%0Aborder%3A%201px%20solid%20%23e1e1e8%3B%0Awhite%2Dspace%3A%20inherit%3B%0A%7D%0Adiv%2Efigure%20%7B%0Atext%2Dalign%3A%20center%3B%0A%7D%0Atable%20%3E%20caption%2C%20div%2Efigure%20p%2Ecaption%20%7B%0Afont%2Dstyle%3A%20italic%3B%0A%7D%0Atable%20%3E%20caption%20span%2C%20div%2Efigure%20p%2Ecaption%20span%20%7B%0Afont%2Dstyle%3A%20normal%3B%0Afont%2Dweight%3A%20bold%3B%0A%7D%0Ap%20%7B%0Amargin%3A%200%200%2010px%3B%0A%7D%0Atable%3Anot%28%5Bclass%5D%29%20%7B%0Amargin%3A%20auto%20auto%2010px%20auto%3B%0A%7D%0Aimg%3Anot%28%5Bclass%5D%29%20%7B%0Abackground%2Dcolor%3A%20%23FFFFFF%3B%0Apadding%3A%202px%3B%0Aborder%2Dradius%3A%203px%3B%0Aborder%3A%201px%20solid%20%23CCCCCC%3B%0Amargin%3A%200%205px%3B%0Amax%2Dwidth%3A%20100%25%3B%0A%7D%0Ah1%20%7B%0Amargin%2Dtop%3A%200%3B%0Afont%2Dsize%3A%2035px%3B%0Aline%2Dheight%3
</head>
<body>
<h1 class="title toc-ignore">Regular polygons and ellipses in grid graphics</h1>
<h4 class="author"><em>Baptiste Auguie</em></h4>
<h4 class="date"><em>2017-09-09</em></h4>
<div id="TOC">
<ul>
<li><a href="#basic-usage">Basic usage</a></li>
<li><a href="#rotated-and-stretched-polygons">Rotated and stretched polygons</a></li>
<li><a href="#ellipses">Ellipses</a></li>
</ul>
</div>
<p>The <code>gridExtra</code> package provides a basic implementation of regular polygons, <code>ngonGrob()/grid.ngon</code>, and a convenience function to draw ellipses, <code>ellipseGrob()/grid.ellipse()</code>. We illustrate below the basic usage of these vectorised functions.</p>
<div id="basic-usage" class="section level2">
<h2>Basic usage</h2>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">library</span>(gridExtra)
<span class="kw">library</span>(grid)
<span class="kw">library</span>(grid)
N &lt;-<span class="st"> </span><span class="dv">5</span>
xy &lt;-<span class="st"> </span><span class="kw">polygon_regular</span>(N)<span class="op">*</span><span class="dv">2</span>
<span class="co"># draw multiple polygons</span>
g &lt;-<span class="st"> </span><span class="kw">ngonGrob</span>(<span class="kw">unit</span>(xy[,<span class="dv">1</span>],<span class="st">&quot;cm&quot;</span>) <span class="op">+</span><span class="st"> </span><span class="kw">unit</span>(<span class="fl">0.5</span>,<span class="st">&quot;npc&quot;</span>),
<span class="kw">unit</span>(xy[,<span class="dv">2</span>],<span class="st">&quot;cm&quot;</span>) <span class="op">+</span><span class="st"> </span><span class="kw">unit</span>(<span class="fl">0.5</span>,<span class="st">&quot;npc&quot;</span>),
<span class="dt">n=</span><span class="kw">seq_len</span>(N)<span class="op">+</span><span class="dv">2</span>, <span class="dt">gp=</span><span class="kw">gpar</span>(<span class="dt">fill=</span><span class="dv">1</span><span class="op">:</span>N))
<span class="kw">grid.newpage</span>()
<span class="kw">grid.draw</span>(g)</code></pre></div>
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAwAAAAJACAYAAAA6rgFWAAAEDWlDQ1BJQ0MgUHJvZmlsZQAAOI2NVV1oHFUUPrtzZyMkzlNsNIV0qD8NJQ2TVjShtLp/3d02bpZJNtoi6GT27s6Yyc44M7v9oU9FUHwx6psUxL+3gCAo9Q/bPrQvlQol2tQgKD60+INQ6Ium65k7M5lpurHeZe58853vnnvuuWfvBei5qliWkRQBFpquLRcy4nOHj4g9K5CEh6AXBqFXUR0rXalMAjZPC3e1W99Dwntf2dXd/p+tt0YdFSBxH2Kz5qgLiI8B8KdVy3YBevqRHz/qWh72Yui3MUDEL3q44WPXw3M+fo1pZuQs4tOIBVVTaoiXEI/MxfhGDPsxsNZfoE1q66ro5aJim3XdoLFw72H+n23BaIXzbcOnz5mfPoTvYVz7KzUl5+FRxEuqkp9G/Ajia219thzg25abkRE/BpDc3pqvphHvRFys2weqvp+krbWKIX7nhDbzLOItiM8358pTwdirqpPFnMF2xLc1WvLyOwTAibpbmvHHcvttU57y5+XqNZrLe3lE/Pq8eUj2fXKfOe3pfOjzhJYtB/yll5SDFcSDiH+hRkH25+L+sdxKEAMZahrlSX8ukqMOWy/jXW2m6M9LDBc31B9LFuv6gVKg/0Szi3KAr1kGq1GMjU/aLbnq6/lRxc4XfJ98hTargX++DbMJBSiYMIe9Ck1YAxFkKEAG3xbYaKmDDgYyFK0UGYpfoWYXG+fAPPI6tJnNwb7ClP7IyF+D+bjOtCpkhz6CFrIa/I6sFtNl8auFXGMTP34sNwI/JhkgEtmDz14ySfaRcTIBInmKPE32kxyyE2Tv+thKbEVePDfW/byMM1Kmm0XdObS7oGD/MypMXFPXrCwOtoYjyyn7BV29/MZfsVzpLDdRtuIZnbpXzvlf+ev8MvYr/Gqk4H/kV/G3csdazLuyTMPsbFhzd1UabQbjFvDRmcWJ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AAQIECAgA9gECBAgQIECAAAECJRIQAEpUbF0lQIAAAQIECBAgIADYBwgQIECAAAECBAiUSEAAKFGxdZUAAQIECBAgQICAAGAfIECAAAECBAgQIFAiAQGgRMXWVQIECBAgQIAAAQICgH2AAAECBAgQIECAQIkEBIASFVtXCRAgQIAAAQIECAgA9gECBAgQIECAAAECJRIQAEpUbF0lQIAAAQIECBAgIADYBwgQIECAAAECBAiUSEAAKFGxdZUAAQIECBAgQICAAGAfIECAAAECBAgQIFAiAQGgRMXWVQIECBAgQIAAAQICgH2AAAECBAgQIECAQIkEBIASFVtXCRAgQIAAAQIECAgA9gECBAgQIECAAAECJRIQAEpUbF0lQIAAAQIECBAgIADYBwgQIECAAAECBAiUSEAAKFGxdZUAAQIECBAgQICAAGAfIECAAAECBAgQIFAiAQGgRMXWVQIECBAgQIAAAQICgH2AAAECBAgQIECAQIkEBIASFVtXCRAgQIAAAQIECAgA9gECBAgQIECAAAECJRIQAEpUbF0lQIAAAQIECBAgIADYBwgQIECAAAECBAiUSEAAKFGxdZUAAQIECBAgQICAAGAfIECAAAECBAgQIFAiAQGgRMXWVQIECBAgQIAAAQICgH2AAAECBAgQIECAQIkEBIASFVtXCRAgQIAAAQIECAgA9gECBAgQIECAAAECJRIQAEpUbF0lQIAAAQIECBAgIADYBwgQIECAAAECBAiUSEAAKFGxdZUAAQIECBAgQICAAGAfIECAAAECBAgQIFAiAQGgRMXWVQIECBAgQIAAAQICgH2AAAECBAgQIECAQIkEBIASFVtXCRAgQIAAAQIECAgA9gECBAgQIECAAAECJRIQAEpUbF0lQIAAAQIECBAgIADYBwgQIECAAAECBAiUSEAAKFGxdZUAAQIECBAgQICAAGAfIECAAAECBAgQIFAiAQGgRMXWVQIECBAgQIAAAQICgH2AAAECBAgQIECAQIkEBIASFVtXCRAgQIAAAQIECAgA9gECBAgQIECAAAECJRIQAEpUbF0lQIAAAQIECBAgIADYBwgQIECAAAECBAiUSEAAKFGxdZUAAQIECBAgQICAAGAfIECAAAECBAgQIFAiAQGgRMXWVQIECBAgQIAAAQICgH2AAAECBAgQIECAQIkEBIASFVtXCRAgQIAAAQIECAgA9gECBAgQIECAAAECJRIQAEpUbF0lQIAAAQIECBAgIADYBwgQIECAAAECBAiUSEAAKFGxdZUAAQIECBAgQICAAGAfIECAAAECBAgQIFAiAQGgRMXWVQIECBAgQIAAAQICgH2AAAECBAgQIECAQIkEBIASFVtXCRAgQIAAAQIECAgA9gECBAgQIECAAAECJRIQAEpUbF0lQIAAAQIECBAgIADYBwgQIECAAAECBAiUSEAAKFGxdZUAAQIECBAgQICAAGAfIECAAAECBAgQIFAiAQGgRMXWVQIECBAgQIAAAQICgH2AAAECBAgQIECAQIkEBIASFVtXCRAgQIAAAQIECAgA9gECBAgQIECAAAECJRIQAEpUbF0lQIAAAQIECBAgIADYBwgQIECAAAECBAiUSEAAKFGxdZUAAQIECBAgQICAAGAfIECAAAECBAgQIFAiAQGgRMXWVQIECBAgQIAAAQICgH2AAAECBAgQIECAQIkEBIASFVtXCRAg0NcC559/fowYMSK22GKLvl619REgQIBAnQSautJUp3VbLQECBAgUVOC2226Lgw46KJ577rlKD5ubm6Ojo6OgvdUtAgQIFEugtVjd0RsCBAgQqKfA888/H/vuu2/ceeed9dyMdRMgQIBAHQWcAlRHXKsmQIBAUQQ6Ozvj6KOPjnXWWcfgvyhF1Q8CBEorIACUtvQ6ToAAgeoEvvvd78bIkSPjsssuiywImAgQIEAg3wJO
</div>
<div id="rotated-and-stretched-polygons" class="section level2">
<h2>Rotated and stretched polygons</h2>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">g2 &lt;-<span class="st"> </span><span class="kw">ngonGrob</span>(<span class="kw">unit</span>(xy[,<span class="dv">1</span>],<span class="st">&quot;cm&quot;</span>) <span class="op">+</span><span class="st"> </span><span class="kw">unit</span>(<span class="fl">0.5</span>,<span class="st">&quot;npc&quot;</span>),
<span class="kw">unit</span>(xy[,<span class="dv">2</span>],<span class="st">&quot;cm&quot;</span>) <span class="op">+</span><span class="st"> </span><span class="kw">unit</span>(<span class="fl">0.5</span>,<span class="st">&quot;npc&quot;</span>),
<span class="dt">n=</span><span class="kw">seq_len</span>(N)<span class="op">+</span><span class="dv">2</span>, <span class="dt">ar=</span><span class="kw">seq_len</span>(N),
<span class="dt">phase=</span><span class="dv">0</span>, <span class="dt">angle=</span>pi<span class="op">/</span>(<span class="kw">seq_len</span>(N)<span class="op">+</span><span class="dv">2</span>),
<span class="dt">size=</span><span class="dv">1</span><span class="op">:</span>N<span class="op">+</span><span class="dv">5</span>, <span class="dt">gp=</span><span class="kw">gpar</span>(<span class="dt">fill=</span><span class="dv">1</span><span class="op">:</span>N))
<span class="kw">grid.newpage</span>()
<span class="kw">grid.draw</span>(g2)</code></pre></div>
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAwAAAAJACAYAAAA6rgFWAAAEDWlDQ1BJQ0MgUHJvZmlsZQAAOI2NVV1oHFUUPrtzZyMkzlNsNIV0qD8NJQ2TVjShtLp/3d02bpZJNtoi6GT27s6Yyc44M7v9oU9FUHwx6psUxL+3gCAo9Q/bPrQvlQol2tQgKD60+INQ6Ium65k7M5lpurHeZe58853vnnvuuWfvBei5qliWkRQBFpquLRcy4nOHj4g9K5CEh6AXBqFXUR0rXalMAjZPC3e1W99Dwntf2dXd/p+tt0YdFSBxH2Kz5qgLiI8B8KdVy3YBevqRHz/qWh72Yui3MUDEL3q44WPXw3M+fo1pZuQs4tOIBVVTaoiXEI/MxfhGDPsxsNZfoE1q66ro5aJim3XdoLFw72H+n23BaIXzbcOnz5mfPoTvYVz7KzUl5+FRxEuqkp9G/Ajia219thzg25abkRE/BpDc3pqvphHvRFys2weqvp+krbWKIX7nhDbzLOItiM8358pTwdirqpPFnMF2xLc1WvLyOwTAibpbmvHHcvttU57y5+XqNZrLe3lE/Pq8eUj2fXKfOe3pfOjzhJYtB/yll5SDFcSDiH+hRkH25+L+sdxKEAMZahrlSX8ukqMOWy/jXW2m6M9LDBc31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AEEEEAAAQQQQIAAgHsAAQQQQAABBBBAAAEPCRAAeKizaSoCCCCAAAIIIIAAAgQA3AMIIIAAAggggAAC
</div>
<div id="ellipses" class="section level2">
<h2>Ellipses</h2>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">g3 &lt;-<span class="st"> </span><span class="kw">ellipseGrob</span>(<span class="kw">unit</span>(xy[,<span class="dv">1</span>],<span class="st">&quot;cm&quot;</span>) <span class="op">+</span><span class="st"> </span><span class="kw">unit</span>(<span class="fl">0.5</span>,<span class="st">&quot;npc&quot;</span>),
<span class="kw">unit</span>(xy[,<span class="dv">2</span>],<span class="st">&quot;cm&quot;</span>) <span class="op">+</span><span class="st"> </span><span class="kw">unit</span>(<span class="fl">0.5</span>,<span class="st">&quot;npc&quot;</span>),
<span class="dt">angle=</span><span class="op">-</span><span class="dv">2</span><span class="op">*</span><span class="kw">seq</span>(<span class="dv">0</span>,N<span class="op">-</span><span class="dv">1</span>)<span class="op">*</span>pi<span class="op">/</span>N<span class="op">+</span>pi<span class="op">/</span><span class="dv">2</span>,
<span class="dt">size=</span><span class="dv">5</span>, <span class="dt">ar=</span><span class="dv">3</span>, <span class="dt">gp=</span><span class="kw">gpar</span>(<span class="dt">fill=</span><span class="dv">1</span><span class="op">:</span>N))
<span class="kw">grid.newpage</span>()
<span class="kw">grid.draw</span>(g3)</code></pre></div>
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAwAAAAJACAYAAAA6rgFWAAAEDWlDQ1BJQ0MgUHJvZmlsZQAAOI2NVV1oHFUUPrtzZyMkzlNsNIV0qD8NJQ2TVjShtLp/3d02bpZJNtoi6GT27s6Yyc44M7v9oU9FUHwx6psUxL+3gCAo9Q/bPrQvlQol2tQgKD60+INQ6Ium65k7M5lpurHeZe58853vnnvuuWfvBei5qliWkRQBFpquLRcy4nOHj4g9K5CEh6AXBqFXUR0rXalMAjZPC3e1W99Dwntf2dXd/p+tt0YdFSBxH2Kz5qgLiI8B8KdVy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tTc7nb/f73TWPkD/qwBnjX8BoJ98VVBg/m8AAEAASURBVHgB7N0HgFTV9fjxM7PLLrD0zqJUEbCLFAuIIKAoYu9RIaI/jb3EFo2oico/tiQaeyBGRTTG2BUbIKgUBQsiKqAISy8CC2yb+Z/zdhcWhJVl57V535s8Z5mdeffez30ze897990bS2oSEgIIIIAAAggggAACCERCIB6JWlJJBBBAAAEEEEAAAQQQcAQIADgQEEAAAQQQQAABBBCIkAABQIQam6oigAACCCCAAAIIIEAAwDGAAAIIIIAAAggggECEBAgAItTYVBUBBBBAAAEEEEAAAQIAjgEEEEAAAQQQQAABBCIkQAAQocamqggggAACCCCAAAIIEABwDCCAAAIIIIAAAgggECEBAoAINTZVRQABBBBAAAEEEECAAIBjAAEEEEAAAQQQQACBCAkQAESosakqAggggAACCCCAAAIEABwDCCCAAAIIIIAAAghESIAAIEKNTVURQAABBBBAAAEEECAA4BhAAAEEEEAAAQQQQCBCAgQAEWpsqooAAggggAACCCCAAAEAxwACCCCAAAIIIIAAAhESIACIUGNTVQQQQAABBBBAAAEECAA4BhBAAAEEEEAAAQQQiJAAAUCEGpuqIoAAAggggAACCCBAAMAxgAACCCCAAAIIIIBAhAQIACLU2FQVAQQQQAABBBBAAAECAI4BBBBAAAEEEEAAAQQiJEAAEKHGpqoIIIAAAggggAACCBAAcAwggAACCCCAAAIIIBAhAQKACDU2VUUAAQQQQAABBBBAgACAYwABBBBAAAEEEEAAgQgJEABEqLGpKgIIIIAAAggggAACBAAcAwgggAACCCCAAAIIREiAACBCjU1VEUAAAQQQQAABBBAgAOAYQAABBBBAAAEEEEAgQgIEABFqbKqKAAIIIIAAAggggAABAMcAAggggAACCCCAAAIREiAAiFBjU1UEEEAAAQQQQAABBAgAOAYQQAABBBBAAAEEEIiQAAFAhBqbqiKAAAIIIIAAAgggQADAMYAAAggggAACCCCAQIQECAAi1NhUFQEEEEAAAQQQQAABAgCOAQQQQAABBBBAAAEEIiRAABChxqaqCCCAAAIIIIAAAggQAHAMI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uyKwIkBBBAAIH0EOAbPT3akVoggAACjoDN5JOqzr/t0PZl+yQhgAACCKSPAFcA0qctqQkCCERcYPbs2bL33ntLqmd3jsViMmvWLOnSpUvEhak+AgggkB4CBADp0Y7UAgEEEJCOHTvK999/74rEHnvsId99950r+2anCCCAAALeCjAEyFtvckMAAQRcEbAFvNzq/FuBbd8sEuZK07FTBBBAwHMBrgB4Tk6GCCCAQOoF6tWrJ+vWrUv9jivssW7durJ27doKz/AjAggggEAYBbgCEMZWo8wIIIBABQE7M+9259+yszweffTRCjnzIwIIIIBAGAW4AhDGVqPMCCCAQAWBli1bypIlSyo8496PllcqZxlyr6TsGQEEEEBgRwJcAdiRDM8jgAAC
</div>
<script type="text/javascript">
window.onload = function() {
var i, fig = 1, caps = document.getElementsByClassName('caption');
for (i = 0; i < caps.length; i++) {
var cap = caps[i];
if (cap.parentElement.className !== 'figure' || cap.nodeName !== 'P')
continue;
cap.innerHTML = '<span>Figure ' + fig + ':</span> ' + cap.innerHTML;
fig++;
}
fig = 1;
caps = document.getElementsByTagName('caption');
for (i = 0; i < caps.length; i++) {
var cap = caps[i];
if (cap.parentElement.nodeName !== 'TABLE') continue;
cap.innerHTML = '<span>Table ' + fig + ':</span> ' + cap.innerHTML;
fig++;
}
}
</script>
<!-- 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>