<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/7-alternatives-to-word-clouds-for-visualizing-long-lists-of-data/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://www.displayr.com/alternatives-word-cloud/?utm_medium=Feed&utm_source=Syndication"> R – Displayr</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>Creating a meaningful visualization from data with long lists can be challenging. While word clouds are often the popular choice, they are not always the best option. This post illustrates seven alternatives to word clouds that can be used to visualize data from long lists, each has its own trade-offs. The visualization examples in this post use the GDP of 185 countries and are created using R.</p>
<hr>
<h2><span>The common option: A word (phrase) cloud…</span></h2>
<p>This visualization below is a <em>phrase cloud, </em>showing the whole names of countries (i.e., phrases) rather than just words. The size of each country in the cloud is in proportion to its GDP. While word clouds are often ridiculed, they do scale well. Unlike most charts, a word cloud gets better with the more things that it displays. But word clouds are far from perfect. The rest of this post explores some better alternatives to word clouds.</p>
<p><img sizes="(max-width: 772px) 100vw, 772px" src="https://i1.wp.com/www.displayr.com/wp-content/uploads/2017/09/gdpWordCloud-1.png?w=450&ssl=1" alt="Word cloud of global GDP" class="wp-image-3374" data-recalc-dims="1"></p>
<hr>
<h2><span>Alternative 1: Circle packing</span></h2>
<p>One standard “fix” to word clouds involves creating a bubble chart with a <em><a rel="nofollow" href="https://mbostock.github.io/d3/talk/20111116/pack-hierarchy.html" target="_blank">circle packing</a> </em>algorithm to arrange the bubbles<em>. </em>This avoids the problem that different word lengths bring to word clouds. However, despite their appeal, in this case, the cure is worse than the illness. The small size of the bubbles prevents writing in the labels of all the countries. I have to put the names into <em>tooltips</em> which appear when you hover your mouse over the bubbles (click on the visualization to view). While I love these plots, I am not a great fan of tooltips for critical information. You can, no doubt, appreciate this point if you access this from a mobile device or the R-Bloggers website, where the tooltips cannot be seen unless you click on the visualization.</p>
<p>While I love these plots, I am not a great fan of tooltips for critical information. You can, no doubt, appreciate this point if you access this from a mobile device or the R-Bloggers website, where the tooltips cannot be seen unless you click on the visualization.</p>
<div class="wp-caption"><a rel="nofollow" href="https://embedded.azureedge.net/75668/231733/8cd53e41-68ce-4e77-8e63-bce202a17c9c.html?v=29062-354f82b68e103772089" target="_blank"><img sizes="(max-width: 557px) 100vw, 557px" src="https://i2.wp.com/www.displayr.com/wp-content/uploads/2017/09/bubble-chart-packed.png?w=450&ssl=1" alt=" bubble chart with a circle packing" title=" bubble chart with a circle packing" class="wp-image-3459" data-recalc-dims="1"></a>
<p class="wp-caption-text">Click the image for an interactive version.</p>
</div>
<hr>
<h2><span>Alternative 2: Cartogram</span></h2>
<p>Rather than packing the circles close together, we can spread them out on a map. I have done this in the <em>cartogram </em>below. The resulting visualization, in most regards, improves on the visualizations above. Problems, however, occur here too. The cartogram relies on a firm understanding of geography, and it fails completely for Europe, where <em>overplotting </em>causes issues. If you have a scroll wheel on your mouse you can zoom in (go to the <a rel="nofollow" href="https://embedded.azureedge.net/75668/231733/e3e20361-8781-46d5-927e-7a69927a866e.html?v=29062-354f82b68e619983689" target="_blank">interactive cartogram</a>). Nevertheless, just as with including names in tooltips (as done with the circle packing), this is a salve rather than a cure. The IMF, who provided <a rel="nofollow" href="https://en.wikipedia.org/wiki/List_of_countries_by_GDP_(nominal)" target="_blank">the data used in this post</a>, have <a rel="nofollow" href="http://www.imf.org/external/datamapper/NGDPD@WEO/OEMDC/ADVEC/WEOWORLD" target="_blank">created a nicer interactive cartogram</a> if you want to see how to do this better.</p>
<div class="wp-caption"><a rel="nofollow" href="https://embedded.azureedge.net/75668/231733/e3e20361-8781-46d5-927e-7a69927a866e.html?v=29062-354f82b68e619983689" target="_blank"><img sizes="(max-width: 702px) 100vw, 702px" src="https://i0.wp.com/www.displayr.com/wp-content/uploads/2017/09/cartogram-gdp.png?w=450&ssl=1" alt="Cartogram" class="wp-image-3465" data-recalc-dims="1"></a>
<p class="wp-caption-text">Click the image for an interactive version.</p>
</div>
<hr>
<h2><span>Alternative 3: Choropleth</span></h2>
<p>A <em>choropleth </em>solves the cartogram’s <em>overplotting </em>problem. However, it introduces a different problem. The choropleth below gives a very poor understanding of the distributions of GDPs, essentially splitting the world into three tiers: US, China, and others.</p>
<p> </p>
<div class="wp-caption"><a rel="nofollow" href="https://embedded.azureedge.net/75668/231733/761527b5-1673-46a5-ad92-c04c9d92424c.html?v=28776-fcdfeecfd9672592926" target="_blank"><img sizes="(max-width: 754px) 100vw, 754px" src="https://i1.wp.com/www.displayr.com/wp-content/uploads/2017/09/choropleth-mono-gdp-1.png?w=450&ssl=1" alt="Choropleth" class="wp-image-3467" data-recalc-dims="1"></a>
<p class="wp-caption-text">Click the image for an interactive version. </p>
</div>
<hr>
<p>We can improve our ability to distinguish between the countries with smaller GDP by changing to a multi-color scale and transforming the data, as shown below. This does a much better job at allowing us to understand Africa. It also brings to the fore the poor state of the economies of central Asia, which is a feature not emphasized by any of the other visualizations. However, this sharpening of discrimination among the smaller economies comes at a large cost. The naked eye struggles to discriminate between the bigger economies (e.g., Australia vs the US). Furthermore, just as the word cloud struggles when words differ in lengths, the choropleth has its own biases relating to the size of the countries. For example, Japan and Europe can easily be overlooked on this map.</p>
<div class="wp-caption"><a rel="nofollow" href="https://embedded.azureedge.net/75668/231733/a8696537-c093-4bcb-a8d6-a01ad781490d.html?v=28776-fcdfeecfd9-622473513" target="_blank"><img sizes="(max-width: 795px) 100vw, 795px" src="https://i1.wp.com/www.displayr.com/wp-content/uploads/2017/09/gdp-choropleth-colorful.png?w=450&ssl=1" alt="Choropleth with multi-colored scale" class="wp-image-3469" data-recalc-dims="1"></a>
<p class="wp-caption-text">Click the image for an interactive version.</p>
</div>
<p>Geographic visualization probably works the best for this particular data set. The next few visualizations are much more generally applicable, as they can be used for non-geographic data.</p>
<hr>
<h2><span>Alternative 4: The horn of plenty</span></h2>
<p>The visualization below takes the bubbles from the cartogram and circle packing and orders them by size, which creates a surprisingly effective way visualizing the distribution of population sizes. However, once more the critical information about which country is which is hidden in tooltips (click on the image), making this a poor visualization for most problems.</p>
<div class="wp-caption"><a rel="nofollow" href="https://embedded.azureedge.net/75668/231733/2aea0695-5039-4ef2-9579-ae2bc24b8d63.html?v=28776-fcdfeecfd9466760677" target="_blank"><img sizes="(max-width: 646px) 100vw, 646px" src="https://i2.wp.com/www.displayr.com/wp-content/uploads/2017/09/horn-of-plenty-gdp-no-labels.png?w=450&ssl=1" alt="The horn of plenty visualization" class="wp-image-3470" data-recalc-dims="1"></a>
<p class="wp-caption-text">Click the image for an interactive version</p>
</div>
<p>We can make the point that the US and China are the world’s largest economies by adding labels. However, this is not such a compelling improvement. Most viewers could likely have guessed what these labels tell them anyway.</p>
<p><img sizes="(max-width: 646px) 100vw, 646px" src="https://i1.wp.com/www.displayr.com/wp-content/uploads/2017/09/LabeledHornOfPlenty-1024x202.png?w=450&ssl=1" alt="The horn of plenty visualization with labels" class="wp-image-3390" data-recalc-dims="1"></p>
<hr>
<h2><span>Alternative 5: Treemap</span></h2>
<p>All the previous bubbles and plots showed size proportional to diameter, which provides a challenge to most quantitatively-oriented minds, and certainly introduces a degree of perceptual error. <em>Treemaps</em> are the rectangular cousin of bubble charts with circle packing, with the area of each rectangle proportional to GDP. Of the non-geographic visualizations, it is the best one so far, in that it both shows the distribution in a striking Escher-like way while allowing us to see the labels for most of the big countries. But, it is still not without problems. Some countries cannot be found. And, the relative ordering for all but the four largest economies is hard to discern.</p>
<div class="wp-caption"><a rel="nofollow" href="https://embedded.azureedge.net/75668/231733/7acae601-cc5a-4d02-8668-670ea49af238.html?v=28776-fcdfeecfd9-1491559751" target="_blank"><img sizes="(max-width: 682px) 100vw, 682px" src="https://i0.wp.com/www.displayr.com/wp-content/uploads/2017/09/cX-htmlwidget-77bae83fbfdce76e0e6b-cx.png?w=450&ssl=1" alt="Treemap" class="wp-image-3471" data-recalc-dims="1"></a>
<p class="wp-caption-text">Click the image for an interactive version</p>
</div>
<hr>
<h2><span>Alternative 6: A donut chart (it does a surprisingly good job)</span></h2>
<p>As I have mentioned before, <a rel="nofollow" href="https://www.displayr.com/why-pie-charts-are-better-than-bar-charts/" target="_blank">the hatred that most numerate people have of pie charts is not justified</a>. To my mind, the <em>donut chart</em> below outperforms all the non-geographic visualizations examined so far. Notably, it emphasizes aspects of the data not evident in any of the other visualizations. For example, it allows us to see that biggest four countries’ GDP exceeds that of the rest of the world.  If you are wanting to find data for one of the countries with a smaller GDP, you can, unfortunately, only do so via tooltips.</p>
<p><iframe src="https://embedded.azureedge.net/75668/231733/24fac2c5-bf19-4653-bd9d-d8eac6297255.html?v=29062-354f82b68e-181406836" width="450" height="404.2973"></iframe></p>
<hr>
<h2><span>Alternative 7: Grid of bar charts</span></h2>
<p>I call this last visualization a <em>grid of bars. </em>It consists of a series of bar charts next to each other. I have created each of these charts using R. Then, I laid them out and added a heading in Displayr. You can do this just as easily in PowerPoint or any design app. For a description of how I created it, see my post <a rel="nofollow" href="https://www.displayr.com/functions-chart-templates/" target="_blank">A Beginners Guide to Using Functions to Create Chart Templates Using R</a>.</p>
<p>This visualization is not pretty, but it is the only visualization which manages to adequately convey the distribution as well as all the detail. Its only real technical limitation is that it can be hard to find a specific country (which is less of a problem in the earlier geographic visualizations).</p>
<p><img sizes="(max-width: 1024px) 100vw, 1024px" src="https://i2.wp.com/www.displayr.com/wp-content/uploads/2017/09/GridOfBars-1024x668.png?w=450&ssl=1" alt="Grid of bar charts" class="wp-image-3424" data-recalc-dims="1"></p>
<hr>
<h2><span>What have I missed?</span></h2>
<p>In this post, I have shown eight different ways of visualizing long lists of data. Do you know of any better methods? If so, please add a comment.</p>
<hr>
<h2><span>Explore the visualizations yourself</span></h2>
<p>You can log into Displayr and access the document used to <a rel="nofollow" href="https://app.displayr.com/Try/Word%20Cloud%20Alternatives" target="_blank">create each of these visualizations here</a> (just sign in first). To see the R code, click on a visualization and the look in <strong>Properties ></strong> <span>R CODE</span> on the right of the screen.</p>
<hr>
<h2><span>Acknowledgements</span></h2>
<p>The bubble charts with circle packing use Joe Cheng’s <span><a rel="nofollow" href="https://github.com/jcheng5/bubbles" target="_blank">bubbles</a></span> package. The cartogram, choropleth, horn of plenty, and grid of bars use <span>plotly</span>. The treemap uses <span>canvasXpress</span>.</p>
<p> </p>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://www.displayr.com/alternatives-word-cloud/?utm_medium=Feed&utm_source=Syndication"> R – Displayr</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/5HbD74QElec" height="1"></a></div>