First a confession, I don’t like cartograms, at least not the kind where complex boundaries are warped sometimes beyond recognition. However they do have their place and where there aren’t the extremes in the data a cartogram can be a great data visualisation. It is outliers or extreme values that cause the maps to be distorted beyond usable recognition, and therefore look bad (see below).
By John Paull and Benjamin Hennig (http://orgprints.org/30187/) [CC BY 3.0 (http://creativecommons.org/licenses/by/3.0)], via Wikimedia Commons
Anyway, if your data isn’t going to produce a map like this then you can use the Cartogram plugin in QGIS. This allows you to quickly turn your map into one that removes the misrepresentation of small areas hiding large values.
The Cartogram Plugin
To start creating your Cartogram you will need to add in the Cartogram plugin using the Manage and Install Plugins interface:
Search for Cartogram, once installed you should see it in your list of plugins:
We are going to use the London Boroughs for this exercise which we are going to scale by the number of people that voted in the EU Referendum.
The data can be downloaded here in GeoPackage format:
The plugin makes this all super simple, just start the plugin by clicking on the Vector menu at the top of the screen then Cartogram and Create Cartogram:
A very simple interface opens where you select the data you want and the attribute you want to scale it by:
In this example select the LondonBoroughEURef as the Input layer and then the Votes as the Area field.
Before you click OK it asks you how many iterations to perform. The default is 5 and this is about right. After this the difference you get is increasingly marginal, with the difference between 10 and 15 iterations imperceptible in most areas.
You might be able to see that there isn’t much difference between the change from 4 to 5 iterations and 5 to 10 iterations. However there is a much bigger wait for creating a 10 iteration cartogram than there is for a 5 iteration one. All these images have been combined here with the darkest being 10 iterations and the lightest the original London Boroughs:
IMPORTANT NOTE: Each time you run the Cartogram Plugin it creates a new virtual layer called Cartogram. You will need to save this if you want to do anything with it, or not loose it if you close QGIS without saving.
Final Tips and Tricks
If you want to make a cartogram out of data that has got outliers or extreme values there are few things you can do to prevent the distortion affecting your the usability of the map.
We have seen that the plugin will provide you with intermediate steps between the base data and the final number of iterations you choose. By generating a map for each of the intermediate numbers of iterations you can create a series that can be animated. Just use the Save as Image… option from the Project menu to create a .png file for each one:
You can then use your favourite animated GIF maker on the internet (just google it) or put it into any movie maker package you have access to. The result will show people how the areas have changed and explain areas where the warping makes them unrecognisable:
Tone down the effect
Tackling the Curse of Cartograms: addressing misrepresentation due
to invisibility and to distortion
In it they describe a few ways that will help mitigate the problems of extreme cartograms. However you may need to use a different method from the cartogram plugin to achieve the desired effect.