Showing Refugees Some Love

The terrorist attacks in Paris on November 13 brought renewed attention to the movement of refugees from Syria to the West. Unfortunately, much of this attention has been negative, despite the fact that refugees are fleeing the very brutality that was unleashed on Paris. The rhetoric from the Republican presidential candidates in the U.S. has been particularly vile. However, many people around the world continue to welcome refugees and show compassion. That’s why I made this visualization:

This map shows positive media coverage of refugees over the past 24 hours (updated hourly). Each animated marker represents one positive media mention about refugees in a particular location.

The data comes from GDELT (The Global Database of Events, Language, and Tone). GDELT’s Global Knowledge Graph monitors media in 65 languages around the world and uses algorithms to measure the emotions and tone of the texts. The map shows results on the theme of “refugees” with a tone of greater than two. Tone is the most basic GDELT parameter, and measures how positive or negative a media article is. So, for example, this article about how churches in Kansas and Nebraska are ready to help refugees is included in the dataset.

How I made the map

This map is a nice demonstration of some useful CartoDB features, such as sync tables, animation, and custom map projections.

I used the GDELT Global Knowledge Graph API to pull the data and load it into CartoDB. The exact API call is:,name,tone&OUTPUTTYPE=2

This returns a geojson file with all the results over the last 24 hours tagged with the “refugees” theme. Using CartoDB’s sync tables you can set the data table to update automatically. Mine updates every hour.

I filtered the results to only include articles with a tone score of greater than two (positive coverage), and then used CartoDB’s Torque tool to create the animation with a custom marker (the heart).

The map projection is a modified Bonne, with the standard parallel set to 90 degrees North to make it appear more heart-shaped. Here is a useful tutorial for using different projections in CartoDB.

Inspiration came from this blog post, and this tutorial was very helpful in figuring out how to use the GDELT API. You can access the data from my CartoDB page here and easily create a map of your own.

Illustrating the Arc of European Colonialism Using a Dot Plot

A while back I was thinking about European colonialism and the enormous impact it’s had on world history. Wouldn’t it be nice to have a simple visualization to illustrate colonization and decolonization around the world? It occurred to me that a dumbbell dot plot would work well for this task. Here’s what I came up with:


The chart shows the dates of colonization and independence of 100 current nations. The countries are organized into broad regions (Asia, Africa, and the Americas), and sorted by date of independence. Color represents the principal colonial power, generally the occupier for the greatest amount of time.

There are many interesting patterns visible in the chart. For example, you can clearly see Spain’s rapid conquest of Central and South America, and then even more rapid loss of its colonies in the 1820s. The scramble for Africa in the late 19th century stands out well, as does the rapid decolonization phase of the late 1950s through early 1970s.

About the Data

To reduce complexity to a manageable level, I set some limitations on what countries to include. First, the chart shows only those countries victim to Western European colonialism. I don’t include Ottoman, Japanese, Russian, American, or other colonial empires. I also don’t include territories that are still governed by former colonial powers (e.g. Gibraltar). This gets controversial and complicated. Countries that were uninhabited upon discovery by colonial powers are also not included. The same with countries that later gained independence from a post-colonial state (e.g. South Sudan).

The dates of independence come from the CIA World Factbook (here). Dates of colonization were derived by my own research, mostly from Wikipedia country pages. I quickly found that establishing a date of colonization is a somewhat subjective decision. Do you choose the date of first European contact? Formal incorporation of the territory into the colonial empire? For the most part, I chose the date of the first permanent European settlement. Notes on the rationale for the date chosen are include in the data spreadsheet (below). In looking at the chart, it’s important to remember that in many cases colonial subjugation was a long process, moving from initial contact, to trade, conquest, settlement, and incorporation.

Constructing the Plot

I wanted to make this plot using ggplot2 in R, but was not sure about best approach. So I reached out on Twitter to dataviz guru and dot plot enthusiast @evergreendata

The response from the #rstats and dataviz community was extremely constructive and useful. Users  @hrbrmstr@jalapic@ramnath_vaidya, and @plotlygraphs all provided great examples (here, here, here, and here, respectively). In the end, I chose to adapt the approach taken by @jalapic.

A quick note on color: I choose colors from the flags of the principal colonial powers to represent them on the plot (except for the Netherlands for which I picked orange). The idea is to make it easier for the viewer to match the color with the country without having to always go back to the legend. I’d be interested in any reactions to this approach. In general, I’d be thrilled with any feedback on how to make this plot better.

Data and code for the plot: