<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>computing | Robin Lovelace</title><link>https://robinlovelace.net/old-site/tag/computing/</link><atom:link href="https://robinlovelace.net/old-site/tag/computing/index.xml" rel="self" type="application/rss+xml"/><description>computing</description><generator>Wowchemy (https://wowchemy.com)</generator><language>en-us</language><lastBuildDate>Mon, 30 Mar 2020 00:00:00 +0000</lastBuildDate><image><url>https://robinlovelace.net/old-site/media/icon_hu93dbabadc2a9bdd4930d1377c0b338b2_5137_512x512_fill_lanczos_center_3.png</url><title>computing</title><link>https://robinlovelace.net/old-site/tag/computing/</link></image><item><title>Installing spatial R packages on Ubuntu</title><link>https://robinlovelace.net/old-site/post/installing-spatial-r-packages-on-ubuntu/</link><pubDate>Mon, 30 Mar 2020 00:00:00 +0000</pubDate><guid>https://robinlovelace.net/old-site/post/installing-spatial-r-packages-on-ubuntu/</guid><description>&lt;p>Having recently acquired a new laptop, an &lt;a href="https://www.entroware.com/store/laptops/proteus" target="_blank" rel="noopener">Entroware Proteus&lt;/a> (shown below), I had to remind myself how to set-it-up for my needs.
This includes the usual things like document editing, web browsing and email.
But as much of my work involves developing and using R for geographic research it had to have R installed.&lt;/p>
&lt;div class="figure">
&lt;img src="https://www.entroware.com/store/image/cache/catalog/entroware/products/laptops/el07r3/proteus-el07r3-front-open-400x500.jpg" alt="The Etroware Proteus, my new Linux laptop" />
&lt;p class="caption">&lt;span id="fig:unnamed-chunk-1">&lt;/span>Figure 1: The Etroware Proteus, my new Linux laptop&lt;/p>
&lt;/div>
&lt;p>I documented the process of upgrading Ubuntu, adding the appropriate software repositories and installing packages in a recent blogpost on the website &lt;a href="https://geocompr.github.io/" target="_blank" rel="noopener">geocompr.github.io&lt;/a>, the website supporting our open source book &lt;a href="https://geocompr.robinlovelace.net/" target="_blank" rel="noopener">Geocomputation with R&lt;/a>.&lt;/p>
&lt;p>If you use Ubuntu, or are thinking of switching to Ubuntu (a sensible choice for someone looking for a user-friendly and stable mostly open source operating system), check-out the details here: &lt;a href="https://geocompr.github.io/post/2020/installing-r-spatial-ubuntu/" target="_blank" rel="noopener">https://geocompr.github.io/post/2020/installing-r-spatial-ubuntu/&lt;/a>&lt;/p>
&lt;p>Enjoy!&lt;/p></description></item><item><title>Coxcomb plots and 'spiecharts' in R</title><link>https://robinlovelace.net/old-site/post/2013-12-27-coxcomb-plots-spiecharts-r/</link><pubDate>Fri, 27 Dec 2013 00:00:00 +0000</pubDate><guid>https://robinlovelace.net/old-site/post/2013-12-27-coxcomb-plots-spiecharts-r/</guid><description>&lt;p>After switching to a new site I decided to revive some old posts.
I found this one that was written back 7 years ago (in January 2021 when this update was written), back in December 2013.
The results of the book are now published in the book &lt;a href="https://www.routledge.com/Low-Impact-Living-A-Field-Guide-to-Ecological-Affordable-Community-Building/Chatterton/p/book/9780415661614">Low Impact Living: A Field Guide to Ecological, Affordable Community Building&lt;/a> (Chatterton, 2015, for more info on the Lilac project in particular and cohousing in general see &lt;a href="https://www.lilac.coop/resources/">lilac.coop/resources/&lt;/a>).
I was amazed to find that, with some tweaks, the &lt;code>ggplot2&lt;/code> code still ran.&lt;/p>
&lt;p>I was contacted recently by a housing organisation who wanted
an attractive visualisation of their finances, arranged in a circular
form. Because there were two 4 continuous variables to include, all
of which were proportions of each other, the client suggested a plot
similar to a pie chart, but with each segment extending out a different
radius from the segment. I realised later that what I had been asked to
make was a modified &lt;a href="http://en.wikipedia.org/wiki/Coxcomb_diagram#Polar_area_diagram">coxcomb&lt;/a>
plot, invented by
&lt;a href="http://en.wikipedia.org/wiki/Florence_Nightingale">Florence Nightingale&lt;/a>
to represent statistics on cause of death during the Crimean War.
In fact, I had been asked to make a “&lt;a href="http://www.cs.huji.ac.il/~feit/papers/Spie03TR.pdf">spie chart&lt;/a>.”
This post demonstrates, for the first time to my knowledge, how it can be done
using ggplot2. A reproducible example of this, including sample data input, can be
found on the project’s github repository: &lt;a href="https://github.com/Robinlovelace/lilacPlot" class="uri">https://github.com/Robinlovelace/lilacPlot&lt;/a> . Please fork and attribute as appropriate!&lt;/p>
&lt;div id="reading-and-looking-at-the-data" class="section level2">
&lt;h2>Reading and looking at the data&lt;/h2>
&lt;p>This is the original dataset I was given:&lt;/p>
&lt;pre class="r">&lt;code>u &amp;lt;- &amp;quot;https://github.com/Robinlovelace/lilacPlot/raw/master/F2.csv&amp;quot;
f &amp;lt;- read.csv(u)
knitr::kable(f[1:3, ])&lt;/code>&lt;/pre>
&lt;table>
&lt;thead>
&lt;tr class="header">
&lt;th align="left">H&lt;/th>
&lt;th align="right">Value&lt;/th>
&lt;th align="right">Value.P&lt;/th>
&lt;th align="right">Allocation&lt;/th>
&lt;th align="right">Deposit&lt;/th>
&lt;th align="right">Captial&lt;/th>
&lt;th align="right">Debt&lt;/th>
&lt;th align="right">Cap&lt;/th>
&lt;th align="right">Contribution&lt;/th>
&lt;th align="right">Repayments&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr class="odd">
&lt;td align="left">q&lt;/td>
&lt;td align="right">163827&lt;/td>
&lt;td align="right">0.065&lt;/td>
&lt;td align="right">0.979&lt;/td>
&lt;td align="right">16382&lt;/td>
&lt;td align="right">147445&lt;/td>
&lt;td align="right">0&lt;/td>
&lt;td align="right">2457.405&lt;/td>
&lt;td align="right">1287.24&lt;/td>
&lt;td align="right">0.00&lt;/td>
&lt;/tr>
&lt;tr class="even">
&lt;td align="left">a&lt;/td>
&lt;td align="right">165994&lt;/td>
&lt;td align="right">0.066&lt;/td>
&lt;td align="right">1.022&lt;/td>
&lt;td align="right">16599&lt;/td>
&lt;td align="right">5488&lt;/td>
&lt;td align="right">138847&lt;/td>
&lt;td align="right">2489.910&lt;/td>
&lt;td align="right">208.02&lt;/td>
&lt;td align="right">208.02&lt;/td>
&lt;/tr>
&lt;tr class="odd">
&lt;td align="left">z&lt;/td>
&lt;td align="right">159425&lt;/td>
&lt;td align="right">0.063&lt;/td>
&lt;td align="right">0.933&lt;/td>
&lt;td align="right">15943&lt;/td>
&lt;td align="right">76632&lt;/td>
&lt;td align="right">63601&lt;/td>
&lt;td align="right">2391.375&lt;/td>
&lt;td align="right">995.46&lt;/td>
&lt;td align="right">995.46&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>Without worrying too much about the details, the basics of the dataset are
as follows:&lt;/p>
&lt;ul>
&lt;li>One observation per row, these will later be bars on the box plot&lt;/li>
&lt;li>Two components of data - captital and revenue&lt;/li>
&lt;li>Different orders of magnitude: some data is in absolute monetary terms, some in percentages&lt;/li>
&lt;/ul>
&lt;p>Base on the above points, a prerequisite was to create preliminary plots and manipulate the
data so it would better fit in a coxcomb plot.&lt;/p>
&lt;p>The first stage, however, is to demonstrate how the addition of
&lt;code>coord_polar&lt;/code> to a barchart can conver it into a pie chart:&lt;/p>
&lt;pre class="r">&lt;code>library(ggplot2)
(p &amp;lt;- ggplot(f, aes(x = H, y = Allocation)) + geom_bar(color = &amp;quot;black&amp;quot;, stat = &amp;quot;identity&amp;quot;,
width = 1))&lt;/code>&lt;/pre>
&lt;p>&lt;img src="https://robinlovelace.net/old-site/post/2013-12-27-coxcomb-plots-spiecharts-R_files/figure-html/unnamed-chunk-2-1.png" width="672" />&lt;/p>
&lt;div class="figure">
&lt;img src="" alt="" />
&lt;p class="caption">plot of chunk unnamed-chunk-2&lt;/p>
&lt;/div>
&lt;pre class="r">&lt;code>p + coord_polar()&lt;/code>&lt;/pre>
&lt;p>&lt;img src="https://robinlovelace.net/old-site/post/2013-12-27-coxcomb-plots-spiecharts-R_files/figure-html/unnamed-chunk-3-1.png" width="672" />&lt;/p>
&lt;!-- ![plot of chunk unnamed-chunk-2](https://raw.github.com/Robinlovelace/robinlovelace.github.io/master/figure/unnamed-chunk-22.png) -->
&lt;p>The above example works well, but notice that all the bars are of equal widths.
What we want is to be proportional to a value (variable “Value”) of each observation.
To do this we use the age-old function &lt;code>cumsum&lt;/code>, as described in an
answer to a &lt;a href="http://stackoverflow.com/questions/20688376/how-to-make-variable-bar-widths-in-ggplot2-not-overlap-or-gap">stackexchange question&lt;/a>.&lt;/p>
&lt;pre class="r">&lt;code>w &amp;lt;- f$Value
pos &amp;lt;- 0.5 * (cumsum(w) + cumsum(c(0, w[-length(w)])))
(p &amp;lt;- ggplot(f, aes(x = pos)) + geom_bar(aes(y = Allocation), width = w, color = &amp;quot;black&amp;quot;,
stat = &amp;quot;identity&amp;quot;))&lt;/code>&lt;/pre>
&lt;p>&lt;img src="https://robinlovelace.net/old-site/post/2013-12-27-coxcomb-plots-spiecharts-R_files/figure-html/unnamed-chunk-4-1.png" width="672" />&lt;/p>
&lt;!-- ![plot of chunk unnamed-chunk-3](https://raw.github.com/Robinlovelace/robinlovelace.github.io/master/figure/unnamed-chunk-31.png) -->
&lt;pre class="r">&lt;code>p + coord_polar(theta = &amp;quot;x&amp;quot;) + scale_x_continuous(labels = f$H, breaks = pos)&lt;/code>&lt;/pre>
&lt;p>&lt;img src="https://robinlovelace.net/old-site/post/2013-12-27-coxcomb-plots-spiecharts-R_files/figure-html/unnamed-chunk-5-1.png" width="672" />&lt;/p>
&lt;!-- ![plot of chunk unnamed-chunk-3](https://raw.github.com/Robinlovelace/robinlovelace.github.io/master/figure/unnamed-chunk-32.png) -->
&lt;p>Finally a spie chart has been created. After that revelation, it was essentially about adding the ‘bells and
whistles’, including a 10% line to represent how much more or less than their share each observation was
paying.&lt;/p>
&lt;/div>
&lt;div id="adding-the-10" class="section level2">
&lt;h2>Adding the 10 %&lt;/h2>
&lt;pre class="r">&lt;code>f$Deposit/f$Value&lt;/code>&lt;/pre>
&lt;pre>&lt;code>## [1] 0.09999573 0.09999759 0.10000314 0.09999837 0.10000120 0.10000000
## [7] 0.10000311 0.10000085 0.10000511 0.10000356 0.09999676 0.09999700
## [13] 0.09999812 0.10000511 0.10000085 0.10000240 0.10000000 0.10000694
## [19] 0.09999901 0.09999883&lt;/code>&lt;/pre>
&lt;pre class="r">&lt;code># add 10% in there
p &amp;lt;- ggplot(f)
p + geom_bar(aes(x = pos, y = Allocation), width = w, color = &amp;quot;black&amp;quot;, stat = &amp;quot;identity&amp;quot;) +
geom_bar(aes(x = pos, y = 0.1), width = w, color = &amp;quot;black&amp;quot;, stat = &amp;quot;identity&amp;quot;,
fill = &amp;quot;green&amp;quot;) + coord_polar()&lt;/code>&lt;/pre>
&lt;p>&lt;img src="https://robinlovelace.net/old-site/post/2013-12-27-coxcomb-plots-spiecharts-R_files/figure-html/unnamed-chunk-7-1.png" width="672" />&lt;/p>
&lt;!-- ![plot of chunk unnamed-chunk-4](https://raw.github.com/Robinlovelace/robinlovelace.github.io/master/figure/unnamed-chunk-41.png) -->
&lt;pre class="r">&lt;code># make proportional to area
f$Allo &amp;lt;- sqrt(f$Allocation)
p &amp;lt;- ggplot(f)
p + geom_bar(aes(x = pos, y = Allo, width = w), color = &amp;quot;black&amp;quot;, stat = &amp;quot;identity&amp;quot;) +
geom_bar(aes(x = pos, y = sqrt(0.1), width = w), color = &amp;quot;black&amp;quot;, stat = &amp;quot;identity&amp;quot;,
fill = &amp;quot;green&amp;quot;) + coord_polar()&lt;/code>&lt;/pre>
&lt;pre>&lt;code>## Warning: Ignoring unknown aesthetics: width
## Warning: Ignoring unknown aesthetics: width&lt;/code>&lt;/pre>
&lt;p>&lt;img src="https://robinlovelace.net/old-site/post/2013-12-27-coxcomb-plots-spiecharts-R_files/figure-html/unnamed-chunk-8-1.png" width="672" />&lt;/p>
&lt;!-- ![plot of chunk unnamed-chunk-4](https://raw.github.com/Robinlovelace/robinlovelace.github.io/master/figure/unnamed-chunk-42.png) -->
&lt;pre class="r">&lt;code># add capital
capital &amp;lt;- (f$Captial + f$Deposit)/(f$Value) * f$Allocation
capital &amp;lt;- sqrt(capital)
p + geom_bar(aes(x = pos, y = Allo, width = w), color = &amp;quot;black&amp;quot;, stat = &amp;quot;identity&amp;quot;) +
geom_bar(aes(x = pos, y = capital, width = w), color = &amp;quot;black&amp;quot;, stat = &amp;quot;identity&amp;quot;,
fill = &amp;quot;red&amp;quot;) + geom_bar(aes(x = pos, y = sqrt(0.1), width = w), color = &amp;quot;black&amp;quot;,
stat = &amp;quot;identity&amp;quot;, fill = &amp;quot;green&amp;quot;) + coord_polar() + scale_x_continuous(labels = f$H,
breaks = pos)&lt;/code>&lt;/pre>
&lt;pre>&lt;code>## Warning: Ignoring unknown aesthetics: width
## Warning: Ignoring unknown aesthetics: width
## Warning: Ignoring unknown aesthetics: width&lt;/code>&lt;/pre>
&lt;p>&lt;img src="https://robinlovelace.net/old-site/post/2013-12-27-coxcomb-plots-spiecharts-R_files/figure-html/unnamed-chunk-9-1.png" width="672" />&lt;/p>
&lt;!-- ![plot of chunk unnamed-chunk-4](https://raw.github.com/Robinlovelace/robinlovelace.github.io/master/figure/unnamed-chunk-43.png) -->
&lt;pre class="r">&lt;code># add ablines
p + geom_bar(aes(x = pos, y = Allo, width = w), color = &amp;quot;grey40&amp;quot;, stat = &amp;quot;identity&amp;quot;,
fill = &amp;quot;lightgrey&amp;quot;) + geom_bar(aes(x = pos, y = capital, width = w), color = &amp;quot;grey40&amp;quot;,
stat = &amp;quot;identity&amp;quot;, fill = &amp;quot;red&amp;quot;) + geom_bar(aes(x = pos, y = sqrt(0.1),
width = w), color = &amp;quot;grey40&amp;quot;, stat = &amp;quot;identity&amp;quot;, fill = &amp;quot;green&amp;quot;) + geom_abline(intercept = 1,
slope = 0, linetype = 2) + geom_abline(intercept = sqrt(1.1), slope = 0,
linetype = 3) + geom_abline(intercept = sqrt(0.9), slope = 0, linetype = 3)&lt;/code>&lt;/pre>
&lt;pre>&lt;code>## Warning: Ignoring unknown aesthetics: width
## Warning: Ignoring unknown aesthetics: width
## Warning: Ignoring unknown aesthetics: width&lt;/code>&lt;/pre>
&lt;p>&lt;img src="https://robinlovelace.net/old-site/post/2013-12-27-coxcomb-plots-spiecharts-R_files/figure-html/unnamed-chunk-10-1.png" width="672" />&lt;/p>
&lt;div class="figure">
&lt;img src="https://raw.github.com/Robinlovelace/robinlovelace.github.io/master/figure/unnamed-chunk-44.png" alt="" />
&lt;p class="caption">plot of chunk unnamed-chunk-4&lt;/p>
&lt;/div>
&lt;pre class="r">&lt;code># calculate vertical ablines of divisions
v1 &amp;lt;- 0.51 * f$Value[1]
v2 &amp;lt;- cumsum(f$Value)[17] + f$Value[18] * 0.31
v3 &amp;lt;- cumsum(f$Value)[17] + f$Value[18] * 0.64
p + geom_bar(aes(x = pos, y = Allo, width = w), color = &amp;quot;grey40&amp;quot;, stat = &amp;quot;identity&amp;quot;,
fill = &amp;quot;lightgrey&amp;quot;) +
geom_vline(x = v1, linetype = 5, xintercept = 0) +
geom_vline(x = v2, linetype = 5, xintercept = 0) +
geom_vline(x = v3, linetype = 5, xintercept = 0) +
coord_polar()&lt;/code>&lt;/pre>
&lt;pre>&lt;code>## Warning: Ignoring unknown aesthetics: width&lt;/code>&lt;/pre>
&lt;pre>&lt;code>## Warning: Ignoring unknown parameters: x
## Warning: Ignoring unknown parameters: x
## Warning: Ignoring unknown parameters: x&lt;/code>&lt;/pre>
&lt;p>&lt;img src="https://robinlovelace.net/old-site/post/2013-12-27-coxcomb-plots-spiecharts-R_files/figure-html/unnamed-chunk-11-1.png" width="672" />&lt;/p>
&lt;pre class="r">&lt;code># putting it all together
p &amp;lt;- ggplot(f)
p + geom_bar(aes(x = pos, y = Allo, width = w), color = &amp;quot;grey40&amp;quot;, stat = &amp;quot;identity&amp;quot;,
fill = &amp;quot;lightgrey&amp;quot;) + geom_bar(aes(x = pos, y = capital, width = w), color = &amp;quot;grey40&amp;quot;,
stat = &amp;quot;identity&amp;quot;, fill = &amp;quot;red&amp;quot;) + geom_bar(aes(x = pos, y = sqrt(0.1),
width = w), color = &amp;quot;grey40&amp;quot;, stat = &amp;quot;identity&amp;quot;, fill = &amp;quot;green&amp;quot;) + geom_abline(intercept = 1,
slope = 0, linetype = 2) + geom_abline(intercept = sqrt(1.1), slope = 0,
linetype = 3) + geom_abline(intercept = sqrt(0.9), slope = 0, linetype = 3) +
geom_vline(x = v1, linetype = 5, xintercept = 0) +
geom_vline(x = v2, linetype = 5, xintercept = 0) +
geom_vline(x = v3, linetype = 5, xintercept = 0) +
coord_polar() + scale_x_continuous(labels = f$H, breaks = pos) +
theme_classic()&lt;/code>&lt;/pre>
&lt;pre>&lt;code>## Warning: Ignoring unknown aesthetics: width
## Warning: Ignoring unknown aesthetics: width
## Warning: Ignoring unknown aesthetics: width&lt;/code>&lt;/pre>
&lt;pre>&lt;code>## Warning: Ignoring unknown parameters: x
## Warning: Ignoring unknown parameters: x
## Warning: Ignoring unknown parameters: x&lt;/code>&lt;/pre>
&lt;p>&lt;img src="https://robinlovelace.net/old-site/post/2013-12-27-coxcomb-plots-spiecharts-R_files/figure-html/unnamed-chunk-12-1.png" width="672" />&lt;/p>
&lt;p>The above looks great, but ideally, for an ‘infographic’ feel, it would
have no annoying axes clogging up the visuals. This was done by creating an
entirely new ggpot theme.&lt;/p>
&lt;/div>
&lt;div id="create-theme-with-no-axes" class="section level2">
&lt;h2>Create theme with no axes&lt;/h2>
&lt;pre class="r">&lt;code>theme_infog &amp;lt;- theme_classic() + theme(axis.line = element_blank(), axis.title = element_blank(),
axis.ticks = element_blank(), axis.text.y = element_blank())
last_plot() + theme_infog&lt;/code>&lt;/pre>
&lt;p>&lt;img src="https://robinlovelace.net/old-site/post/2013-12-27-coxcomb-plots-spiecharts-R_files/figure-html/unnamed-chunk-13-1.png" width="672" />&lt;/p>
&lt;/div>
&lt;div id="creating-a-ring" class="section level2">
&lt;h2>Creating a ring&lt;/h2>
&lt;p>To add the revenue element to the graph is not a task to be taken likely.
This was how I tackled the problem, by creating a tall, variable-width
bar chart first, and later adding the original spie chart after:&lt;/p>
&lt;pre class="r">&lt;code>f$Cap.r &amp;lt;- f$Cap/mean(f$Cap) * 0.1 + 1.2
f$Cont.r &amp;lt;- f$Contribution/mean(f$Cap) * 0.1 + 1.2
f$Rep.r &amp;lt;- f$Cont.r + f$Repayments/mean(f$Cap) * 0.1
f$H &amp;lt;- c(&amp;quot;a&amp;quot;, &amp;quot;b&amp;quot;, &amp;quot;c&amp;quot;, &amp;quot;d&amp;quot;, &amp;quot;e&amp;quot;, &amp;quot;f&amp;quot;, &amp;quot;g&amp;quot;, &amp;quot;h&amp;quot;, &amp;quot;i&amp;quot;, &amp;quot;j&amp;quot;, &amp;quot;k&amp;quot;, &amp;quot;l&amp;quot;, &amp;quot;m&amp;quot;, &amp;quot;n&amp;quot;,
&amp;quot;o&amp;quot;, &amp;quot;p&amp;quot;, &amp;quot;q&amp;quot;, &amp;quot;r&amp;quot;, &amp;quot;s&amp;quot;, &amp;quot;t&amp;quot;)
p &amp;lt;- ggplot(f)
p + geom_bar(aes(x = pos, y = Allo, width = w), color = &amp;quot;grey40&amp;quot;, stat = &amp;quot;identity&amp;quot;,
fill = &amp;quot;lightgrey&amp;quot;)&lt;/code>&lt;/pre>
&lt;pre>&lt;code>## Warning: Ignoring unknown aesthetics: width&lt;/code>&lt;/pre>
&lt;p>&lt;img src="https://robinlovelace.net/old-site/post/2013-12-27-coxcomb-plots-spiecharts-R_files/figure-html/unnamed-chunk-14-1.png" width="672" />&lt;/p>
&lt;!-- ![plot of chunk unnamed-chunk-6](https://raw.github.com/Robinlovelace/robinlovelace.github.io/master/figure/unnamed-chunk-61.png) -->
&lt;pre class="r">&lt;code># we need the axes to be bigger for starters - try 1.3 to 1.5
p + geom_bar(aes(x = pos, y = Cap.r, width = w), color = &amp;quot;grey40&amp;quot;, stat = &amp;quot;identity&amp;quot;,
fill = &amp;quot;white&amp;quot;) + geom_bar(aes(x = pos, y = Rep.r, width = w), color = &amp;quot;grey40&amp;quot;,
stat = &amp;quot;identity&amp;quot;, fill = &amp;quot;grey80&amp;quot;) + geom_bar(aes(x = pos, y = Cont.r,
width = w), color = &amp;quot;grey40&amp;quot;, stat = &amp;quot;identity&amp;quot;, fill = &amp;quot;grey30&amp;quot;) + geom_bar(aes(x = pos,
y = 1.196, width = w), color = &amp;quot;white&amp;quot;, stat = &amp;quot;identity&amp;quot;, fill = &amp;quot;white&amp;quot;)&lt;/code>&lt;/pre>
&lt;pre>&lt;code>## Warning: Ignoring unknown aesthetics: width
## Warning: Ignoring unknown aesthetics: width
## Warning: Ignoring unknown aesthetics: width
## Warning: Ignoring unknown aesthetics: width&lt;/code>&lt;/pre>
&lt;p>&lt;img src="https://robinlovelace.net/old-site/post/2013-12-27-coxcomb-plots-spiecharts-R_files/figure-html/unnamed-chunk-15-1.png" width="672" />&lt;/p>
&lt;pre class="r">&lt;code>last_plot() + geom_bar(aes(x = pos, y = Allo, width = w), color = &amp;quot;grey40&amp;quot;,
stat = &amp;quot;identity&amp;quot;, fill = &amp;quot;grey80&amp;quot;) + geom_bar(aes(x = pos, y = capital,
width = w), color = &amp;quot;grey40&amp;quot;, stat = &amp;quot;identity&amp;quot;, fill = &amp;quot;grey30&amp;quot;) + geom_bar(aes(x = pos,
y = sqrt(0.1), width = w), color = &amp;quot;grey40&amp;quot;, stat = &amp;quot;identity&amp;quot;, fill = &amp;quot;black&amp;quot;) +
geom_abline(intercept = 1, slope = 0, linetype = 5) + geom_abline(intercept = sqrt(1.1),
slope = 0, linetype = 3) + geom_abline(intercept = sqrt(0.9), slope = 0,
linetype = 3) + coord_polar() + scale_x_continuous(labels = f$H, breaks = pos) +
theme_infog&lt;/code>&lt;/pre>
&lt;pre>&lt;code>## Warning: Ignoring unknown aesthetics: width
## Warning: Ignoring unknown aesthetics: width
## Warning: Ignoring unknown aesthetics: width&lt;/code>&lt;/pre>
&lt;p>&lt;img src="https://robinlovelace.net/old-site/post/2013-12-27-coxcomb-plots-spiecharts-R_files/figure-html/unnamed-chunk-16-1.png" width="672" />&lt;/p>
&lt;!-- ![plot of chunk unnamed-chunk-6](https://raw.github.com/Robinlovelace/robinlovelace.github.io/master/figure/unnamed-chunk-63.png) -->
&lt;/div>
&lt;div id="just-inner" class="section level2">
&lt;h2>Just inner&lt;/h2>
&lt;p>After all that it was decided it looked nicer with only the inner ring anyway.
Here is the finished product:&lt;/p>
&lt;pre class="r">&lt;code>p &amp;lt;- ggplot(f)
p + geom_bar(aes(x = pos, y = Allo, width = w), color = &amp;quot;grey40&amp;quot;, stat = &amp;quot;identity&amp;quot;,
fill = &amp;quot;grey80&amp;quot;) + geom_bar(aes(x = pos, y = capital, width = w), color = &amp;quot;grey40&amp;quot;,
stat = &amp;quot;identity&amp;quot;, fill = &amp;quot;grey30&amp;quot;) + geom_bar(aes(x = pos, y = sqrt(0.1),
width = w), color = &amp;quot;grey40&amp;quot;, stat = &amp;quot;identity&amp;quot;, fill = &amp;quot;black&amp;quot;) + geom_abline(intercept = 1,
slope = 0, linetype = 5) + geom_abline(intercept = sqrt(1.1), slope = 0,
linetype = 3) + geom_abline(intercept = sqrt(0.9), slope = 0, linetype = 3) +
coord_polar() + scale_x_continuous(labels = f$H, breaks = pos) + theme_infog&lt;/code>&lt;/pre>
&lt;pre>&lt;code>## Warning: Ignoring unknown aesthetics: width
## Warning: Ignoring unknown aesthetics: width
## Warning: Ignoring unknown aesthetics: width&lt;/code>&lt;/pre>
&lt;p>&lt;img src="https://robinlovelace.net/old-site/post/2013-12-27-coxcomb-plots-spiecharts-R_files/figure-html/unnamed-chunk-17-1.png" width="672" />&lt;/p>
&lt;!-- ![plot of chunk unnamed-chunk-7](https://raw.github.com/Robinlovelace/robinlovelace.github.io/master/figure/unnamed-chunk-7.png) -->
&lt;pre class="r">&lt;code>ggsave(&amp;quot;just-inner.png&amp;quot;, width = 7, height = 7, dpi = 800)&lt;/code>&lt;/pre>
&lt;/div></description></item></channel></rss>