Showing posts with label choropleth. Show all posts
Showing posts with label choropleth. Show all posts

Wednesday, 1 February 2017

Dangerous times. Dangerous maps.

A map showing the distribution of people on Trump's foreign banned nationals Executive Order appeared recently.

You can read the full blog post by the publishers here but here's a screen grab in case the tweet is taken down:



There's a few things that upset me about this map.

Firstly it's non-normalized. It shows totals. Choropleths need a rate or ratio. It was pointed out to me that the map uses Congressional Districts as boundaries and that means the populations are 'roughly' the same so it's all ok.

I'm afraid 'roughly' doesn't cut it. Each Congressional District represents about 711,000 people but you'll notice it's also split by state boundaries so, in fact, it's the data per state that's reapportioned into roughly equally populated areas. That'd be fine for mapping if you discounted Montana, Wyoming, North and South Dakota which encompass one Congressional District each. But they have populations of 1 million, 584,000, 740,000 and 853,000 respectively. None of these population totals can be easily split further without resulting in numbers even further away from 711,000 but it means the map of totals fails to respect these differences. This means the visual message is warped when you're trying to compare across the map. The primary function of the choropleth is to support visual comparison and unless you accommodate the underlying discrepancy in populations it doesn't.

The problem is exacerbated because those States are very large anyway so they inevitably dominate the map. Also, because the map uses the inappropriate Web Mercator projection those northern states are enlarged in relation to the rest of the country too - a further warping that our brains won't adjust for in deciphering the map's message.

There's plenty of other techniques that the map's maker could have used - cartograms, proportional symbols, dot density, hex-binning and so on. Each have benefits and each have drawbacks. The authors said they "wanted to stick with the district boundaries so people could see which district they reside in". So they chose to go with geography so people have less of a barrier to understanding the map. Fine - but the consequence of that decision is you have to be prepared to deal with the inherent cognitive bias and work hard to mitigate it properly.

Even if you think I'm being too nerdy about the issue of totals on choropleths (I'm not) then think about it this way...the map suggests around 3,400 as the bottom value of the highest class in the legend per Congressional District that's a lot of people right? Three and a half thousand of them.  As a percentage? Less than 0.5% and, frankly, that doesn't make the map nearly as persuasive.  Dig a little further:


So the upper class actually goes from 3,400 to 51,652.  And look at how tiny that little place is in downtown Los Angeles. 51,652 people all crammed into Congressional District CA-28 which you can hardly see, compared to 1,620 in North Dakota which you can really, really see. The choropleth doesn't help at all here. A different technique altogether would help. But even at 51,652 that's only 7% of the population. Still not exactly a huge proportion.

The data is also a little misleading. Libya cannot be extracted as a separate country from the American Community Survey used as a source for the map so the 'Other North Africa' designation was used - meaning people not on the banned list are included in the map. How many? Hard to know.

And reds? Hey, this is a sensitive issue. I mean a really f*cking sensitive issue. Red is not the colour to use because it's value-laden. We process it in a particular way and it means 'danger'. If the map is supposed to be an impartial display of the data then red is not the colour to use.

Finally, a friend of mine noted to me that they were concerned that the map even existed given it shows WHERE people on the banned list live. Popups even provide broken down summaries by country.  I countered by suggesting that at Congressional District level there's enough generalization to mask real locations but I take the point and it raises an ethical issue for cartography. In a time of unpresidented [sic] political turmoil, is it morally OK to publish this sort of map just because you can easily scrape the data? What purpose does it support? Given the general outrage that the ban on entry from nationals of 7 countries is tantamount to a partial ban on Muslims then the map could easily incite or inflame the situation further. If the intent is to be impartial then you have to be ridiculously careful to ensure you do just that and this map doesn't. Unless you are setting out to be explicitly persuasive or even propagandist, cartographers and map-makers have a responsibility to make maps that are not misleading and when dealing with sensitive subject matter it becomes crucial.

I am absolutely sure that the map-makers here actually had the opposite intention because they include contact details for Congressional Representatives - presumably as a call to action to encourage people to call in their opposition to the ban. Trouble is, for every one that might go to that effort there will be many more that look at a sea of red and interpret it differently. That's the power of maps.

As it stands the map is dangerous. It shows where people live that are currently on a banned list and that serves no purpose. It uses a good technique but poorly which is nothing more than creating visual alternative facts. It uses the wrong projection which exacerbates the problem. It uses slightly dubious data and, certainly, a bad choice of colours. I'd ban this sort of mapping. Period.

Monday, 3 October 2016

Brewdog: Stick to the Beer

I've written about non-normalized choropleths before (e.g. here and here and here) but when one of my favourite breweries makes the mistake I feel compelled to mention it again.

Brewdog are setting up in the USA. This is a good thing because their beer is spectacularly good. I have become an investor in their USA Equity for Punks campaign to support their efforts. But they need a cartographer because their maps are spectacularly bad.  They've been running this map showing how investors are spread across the US.




Clearly they're mapping totals as a choropleth which as most who know me will know gets me really rather upset. I mentioned this to Brewdog but their reply suggest (a) they don't get it and (b) they don't care.


Yes, I get that it's a bit of a fun but that's not actually a good excuse for making a crap map.  I could make some shitty home brew just for fun as well but what's the point of that? I'd rather try and do the job right and make something that tastes good. They've also used a poor blue to red colour scheme but that's a different argument. Anyway, I have offered to help them correct it so just because I can, here's a couple of efforts whipped up in less than an hour.

Here's the (incorrect) totals version as a choropleth in Punk IPA colours:



And here's the same data of the number of investors, normalized by the number of people over 21 (drinking age) in each State to create a 'Punks per Million' map. I guessed on roughly what the data might be from their original map:



Compare thee two maps. You see - because the population of each state differs massively and the size of States differs massively, using totals inevitably skews the map numerically and visually and you get a warped sense of reality. Texas will always come out as a lot. Montana always not. But actually, as a proportion of the population, there are more Punk investors in Montana than Texas. Ohio still gets shown as having the most investors because they have a lot (as totals) and as a proportion of their population and that's where the new brewery is. But California isn't a stand-out because it has roughly the same Punks per million as Oregon and even Wyoming.

Still want to map totals? Well use a proportional symbol map:



There you go - now you can clearly see the huge difference in the pattern of investment between states. And if you want to Punk out the map...well go right ahead:


And yes, I used the same bottletop technique on this quick map as I did on the much larger Breweries of the World map which, if you want a copy, can be downloaded here.


So, Brewdog. I like your beer a lot. You take great care to make it right. I like maps a lot and I take great care to make them right. You stick to brewing and I'll keep drinking your beer. I'll stick to making maps. If you want some help with the maps, just drop me a line.





Tuesday, 17 March 2015

Drug crazed mapping

I had told myself I wasn't going to bite when @Amazing_maps screamed once more for my attention. But the more I tried to ignore, the more it reeled me in so eventually I thought it worth a few comments.

Here's the so-called amazing map:


I've no idea who made it. It doesn't really matter. What I feel matters is the impact maps like this have on those that view it. This is more about the consumption of maps but, of course, their design and construction goes a long way to underpinning the message people take away.

Quick look and take away: Holy drug barons Batman,...San Bernardino is full of crack-heads! So are a few smaller areas I don't even know....but they're really small so they can't be as important eh? Right, must be time for Alaska State Troopers, turn on the TV...

That's how a lot of people will look at this map. Message delivered. Warped view of reality perpetuated. Job done. Wait for the next Amazing Map.

Here's the longer look and take aways I formulated...

Hmm. Something's not quite right with this map. Let's talk it through. It's a choropleth. We can assume from the title...well, the line that doubles as the legend title, what the subject matter is. It's about the labs, not the population so it's about production, not consumption. And the colour scheme goes from light to dark so we see where there are more meth labs and where there are fewer. I'll not repeat myself like a cracked record about it being totals (but it is) and not normalised (but it isn't) suffice to say it needs to have the data transformed into per capita or something equally sensible to allow us to compare like for like. Though critical for a choropleth, let's ignore that for the purposes of this because there's other 'take aways' in this map.

Look at San Bernardino County again...jeesz, it's heaving with meth labs.



This makes me a little more interested (perhaps concerned) as it's where I live. Notwithstanding it's totals, look at that large, expansive area filled with loads of meth labs. How many?...there's about...errr, well, let me look at the legend. hmm. It's dark blue. Does that make it 300, 500, 1000 meth labs?

It's impossible to tell without doing some assessment of the actual RGB values. It's actually closest to the RGB value about 1/3 along the legend colour ramp which would make it about 330ish...though there are no RGB values in the legend that match those found in San Bernardino County so it's impossible to be certain and why am I having to do an RGB analysis of a legend anyway? It shouts out from the map yet is nearer the lower end of the legend. That doesn't seem right.

So San Bernardino leaps out because 1. it's the largest county in the US 2. It has a lot of meth labs (though possibly not per capita or in relation to counties with many more) and 3. It's dark blue and that means 'more' except there's virtually no differentiation between the blue used at 330 and that for 1000. All the variation in colour value is at the lower end.



The map uses an unclassified choropleth approach. That means every data value is given its own position along the chosen colour ramp. I'm not a huge fan of unclassified choropleths. Choropleths are generally used to show where places are similar and that relies on classifying your data into groups that display similar characteristics. All you can really see from an unclassed choropleth is the extremities...which areas tend to the maximum and which to the minimum. It's really difficult to assess where those in-between values might sit...and that's assuming the scale is linear and the colour scheme is applied linearly. Of course, you can stretch colour to be applied non-linearly but then it's an even more confusing picture that's arguably more difficult interpret visually. If you don't classify data before mapping it then you're painting by numbers and it's a bypass to considering your data and teasing out the message through careful classification and symbolisation.

I'm going to add a caveat here - if the map is for interactive web display and the user can hover or click an area to retrieve the value directly, then unclassed choropleths are, arguably, less problematic because people can retrieve values across the map. I'd still contend, however, that if we know the map is classified into, say 5 classes using natural breaks then every county symbolized in the same shade of blue is 'similar'. It's an important metric we can easily see in the map and it's a good default. Other classification schemes exist to suit alternative purposes. If we use, say, a quantile scheme of 5 classes then we know each class shows 20% of the data values in rank order - again, similarity between values, across the entire range values, can be easily seen and it's simple to see which areas are in the top 20% of values.  If you make two choropleths then using something like a quantile scheme allows you to compare the two maps on a comparable cognitive basis. Clicking to retrieve a value is an additional step in the map reading process. Trying to remember values from one hovered-over area to another is equally taxing because our short term recall is not our best cognitive function (think of memorizing and recalling a pack of cards in order...it's not easy!). I like maps to 'show and tell' rather than require further processing or actions by the user to reveal the message.

Onto the colours. Because there are just so many different shades of blue across the map we get a sense of some overall pattern but we can't really tell which are similar to which. How similar is San Bernardion COunty's colour compared to the other dark blues across the other side of the map? It's called simultaneous contrast and is a problem for our map reading. Our perception of a colour (or shades of a colour) varies as we look across the map due to the colours that surround it. Look at the following two grey squares and how they are affected by the surrounding shades:


The grey square differs in perception depending on whether it's surrounded by dark or light.  A darker surround makes us see it lighter than if it has a lighter surround. Now look at how different colours modify the grey square:


The grey squares, despite being the same, take on a perceived tinge of colour based on what's around it. And when the image gets even more complex we have even more difficulty processing what we see. In the following animation, which grey square, A or B, is darker?


Of course, the greys in A and B are the same. In the above diagrams all the grey squares are seen differently simply because of their surroundings. The map of meth labs has over 3,000 counties, each shade of blue being surrounded by it's own different mix of blues.

These perceptual issues are also a problem in classed choropleths of course - but not nearly to the same degree because it's much easier to distinguish and differentiate 5 or 6 shades of blue across a map than it is to try and make sense of several hundred (thousands?) different shades of blue.

And what about labels? Yes we can probably all recognise it's the U.S. I know where my home is so I recognise San Bernardino County. I've no real way of describing where other patterns exist in language that makes sense. Giving people context is important. Interactive maps support this through basemap labels or, again, hover and click...but however you deliver the map, give people a way to reference the patterns they see.

So the take-aways for me...
  • It's totals. If you can't or won't change to a rate or ratio then use something other than choropleth like a dot density, proportional symbol, dasymetric or cartogram.
  • If you have to use unclassed choropleths then scale your data across the range of colour so that extremeties don't dictate the way values map onto the colours. Make the legend more useful by providing labels at key positions and make your map interactive so people can retrieve values.
  • Go with a classed choropleth if you want people to 'see' more than just the extremeties in your data and how different areas are similar to others for all values that display similar characteristics. Learn which classification techniques are going to manage your data most appropriately for the message you want to share.
  • Be aware of the problems of simultaneous contrast.
  • Include some form of labelling to give people a way of referencing the geographical patterns they see.

Other problems...no real title, no source, no credits, no dates, no contact details. Nothing. Like I said, I don't know where the map came from but as is, it's a fail in every respect.

Finally, I tried to get the data to recreate this as a per capita but after a quick search I wasn't able to find it at county level. Instead I came across this abomination on the Drug Enforcement Administration web site:


I don't even know where to start with this one, and they've made one per year for the last few years. They were clearly on something or other. And if we assume the DEA reporting is accurate (and the most current) AND that the Amazing_Maps one is broadly of the same time period (OK, a lot of assumptions) then what's with San Bernardino having over 300 meth labs given California as a whole has only 79?

Clearly something's wrong somewhere. Amazing map? Possibly. It's just poorly designed and constructed and gives a totally misleading impression of a dataset that cannot be verified. It's another potentially mildly interesting dataset that's poorly mapped.

And by the way, San Bernardino County is the 5th most populous county in the US so per capita...we may even have a paucity of meth labs so a different map might support the assertion we need more to get our supply increased*. Additionally, while the overall area of the county is about 20,000 sq miles, the populated areas are predominantly crammed into the south west corner in an area roughly 450 sq miles...which makes a choropleth map of totals covering mostly desert even less useful (unless the meth labs are in the desert). And all those less important smaller areas...Seattle, St Louis, Tulsa and Grand Rapids. But because of the way the boundaries lie, choropleths are always going to cause difficulties in interpretation. That's the Modifiable Areal Unit Problem...and a whole different blog entry.

* this is a joke

Thursday, 20 March 2014

Cart-oh-nono #1: blending choropleths and basemaps

The first post in an occasional series pointing out why what you think is a good idea for your map might not be so cool after all.

Here's a choropleth map. It doesn't matter what it's showing but the use of colour to conotate low to high is fairly easily understood. Yellow is seen as 'low' and as you move through to red you see something that means 'more'.


This works because we see light as less and dark as more and this colour ramp fits that schema. There are 6 colours on this map. We can differentiate them pretty easily. We can therefore easily establish which countries share similar characteristics (the purpose of the map). Any more than 6 or 7 and we start to struggle to distinguish unique colours on the map. Simple. Easily understood but...my don't people find these boring so how about we jazz it up a bit...

Here's another version, this time mashed up onto a topographic basemap.


Is it better?

I'd say no because a choropleth is its OWN basemap and by adding an underlay we add unnecessary visual clutter. Thematics are normally single-themed, so omitting detail that would make them harder to view is a core principle. Slapping it on top of a topographic map that obscures labels and other detail seems pointless. Labels are, in fact, cut off when they perhaps extend across water into the land area anyway. This adds nothing yet putting thematics over the top of topographic basemaps is a trend we see all the time because online basemaps are visible by default (they can normally be switched off).

But it gets worse...I've lately seen this type of choropleth...the blended choropleth.



Here for some reason, known only to the map author, the basemap and the thematic overlay have been blended together. The problem here is that by blending the two maps (or even using transparency for the thematic layer) you actually create a result that leads to significant problems for reading the map, seeing the patterns and understanding the distribution of the mapped theme.

Look at the following version without the water.


It's not now a choropleth. You just destroyed it. This map has, in fact, 44,271 colours. That's a few more than 6 or 7. It's impossible to identify areas of similar characteristics because they no longer exist. It's almost impossible to even see that there's a thematic overlay or that the theme is at country level.

If you really want to blend your choropleth with a basemap...pick something neutral so that there is a consistent canvas. Your colours will change and become a little duller (because you're adding grey) but they will be consistent across each area and will remain relative to one another visually. The following uses a grey basemap. You could argue internal water masses are a problem and you'd be right...but at least the map still functions at a basic level.



Blending choropleths with a basemap is a cart-oh-nono, particularly if you use a topographic basemap. You may think it looks cool, but it isn't. It makes the map that much harder to read and understand. Please don't do it.

Thursday, 19 December 2013

Keep calm and study cartography

As regular readers (and critics...I know who you are) of this blog will know, this is where I point to examples of bad maps and try and explain why they are bad and why life may be that little bit better if they were improved. It strikes me, however, that this is fast becoming a complete waste of time because the tide of poor mapping is beyond endemic...beyond epidemic even. It's a pandemic. What's more...it seems less people neither want to know or care. They are content with sub-par efforts even if they contain basic mistakes.

It's one thing for the internet to provide a mechanism for people to get mapping, but another entirely when such maps are duly picked up and promoted beyond what they are capable of showing...and that's my beef in this blog.

Business Insider were guilty of this with a series of maps they made earlier this year...promoting their own cartographic ignorance (total of 808,000 views to date). This was also the case after the latest viral tweetmap (the Beyonce flawless map) was picked up by several online blogs and then hit TIME magazine online. Now we have another.

Jeff Sackmann of the blog tennisabstract.com has made an app to map ranking of players by country.

Here's a screen shot showing the top 1000 WTA players by country:



Here, then...the classic non-normalised choropleth. The data needs to be per capita. I might have mentioned this before (yawn!) and I was going to leave this map alone until anumber of blogs and then USA Today picked it up. Now to be fair, they do at least point to the same drawback of the maps but it seems to me a pattern is emerging and it goes something like this...

1. Person makes a map...it is alive therefore it is right (the internet says so and no-one's checking anyway)
2. Person self-promotes it on their own blog/site (nothing wrong with that...it's the internet!)
3. Some people look at map...most believe it because it's a map so it must be true.
4. Map becomes the modern equivalent of fish'n'chip paper except...on the odd occasion...

5. Other people in need of content to promote their own site trawl the internet for stuff happen across map
6. Said map is re-promoted on a new site to many more people (ad nauseum)
7. Any problems with the map are lost in the mists of time (the cacophony of 'Likes' speaks volumes)
8. The map is now cool so to be cool you have to like a map that is cool (hit 'Like')
9. A piece of cartography dies and...

11. Bloggers/commentators/experts (like me) get criticised for not liking the latest cool map

Just because I can...here's what the above map should look like when normalised (and on an equal area projection to avoid the visual bias caused by Mercator). I could have stuck this in an online map (to get clicky things so you can see values for each country) but no-one would have 'liked' it so I didn't go that far but I feel it proves the point anyway.



Now...if someone wants to argue that the non-normalised version tells the same story as the normalised version then I'm happy to use pistols at dawn.

I love that people make maps. I just wish more would make them properly...and even more, I'd like for those that promote maps on their own sites for their own purpose to do some basic research to figure out whether what they are showing is actually worth showing. If people reading maps are unable to tell the difference (and why should they...they're busy with their own lives and areas of expertise) then it's beholden on map-makers to make their maps right.

Keep calm and study (a little) cartography.

[update: edits to correct spellings]

Monday, 10 June 2013

Choropleth totals: one more shot

Regular readers might have come across a few comments I've made about the problems of mapping totals using choropleth maps here and there. I bore myself silly sometimes but in a week that's seen the all-knowing National Security Agency PRISM tracking tool report surveillance in one of the worst culprits I have ever seen it's worth giving it one more shot to try and banish the erroneous practice.

The Guardian's reporting of the recording and analysing of voluminous data included a few screen shots of the maps used to show countries' exposure to surveillance. Here's one for the purposes of discussion:


The colours range from green, those with the fewest number of items of surveillance, to red, the most. Putting aside the fact the colour scheme is not easy to interpret (is light green least...or is it dark green?) and that the use of a Mercator projection distorts the size of areas giving false prominence to more northerly and southerly latitudes...let's focus on the data.

So there have been 2,892,343,446 pieces of intelligence data gathered from US computer networks over a 30-day period ending in March 2013. The US is shown the same as Germany, Saudi Arabia, Kenya and Iraq.  The map quite clearly leaves readers with the impression that surveillance is pretty similar across these countries.

Let's assume that each of these countries has 3 billion pieces of information collected (a fair assumption of the mapping of totals above). If we calculate the number of pieces of surveillance data per capita we get an entirely different picture

USA, 313 million people = an average 9.5 pieces of surveillance data per person
Saudi Arabia, 28 million people = an average 106.8 pieces of surveillance data per person
Kenya, 42 million people = an average 72 pieces of surveillance data per person
Iraq, 33 million people = an average 91 pieces of surveillance data per person

Mapping these rates would give an accurate picture and one which, crucially, allows us to visually compare one country against another across the map.  Without normalising our data to a consistent denominator the map is utterly useless. We can't make any sensible interpretations of the information. So, as it turns out the level of surveillance in the US is an order of 10 times less than Saudi Arabia. That is not a story the above map even vaguely illustrates. So it's worrying if these maps are genuinely being used to inform national security don't you think?

In trying to come up with a way for mere mortals to understand, my better half Linda Beale (@lindabeale) came up with a great analogy.  We spent some time over the weekend making some slides to explain the issue...using alcohol, conveniently colour coded green to match the NSA map.  It struck us that if we cannot use logic to explain it then let's dumb this down to something most people can identify with...size of a drink.

So here goes with one more shot...have a look at the following picture:


Two glasses of the same size. It should be fairly easy to see that the glass on the right is holding double that of the left. In fact, the right glass is filled with two shots of Creme de Menthe and the right one has only one (or...his and hers if you will!). Now let's look at adding a third glass:


The glass on the right is a different size and shape so how much Creme de Menthe does it hold? Trickier question eh? Is it one shot, two shots or somewhere in between? In fact it's one shot but it doesn't look the same as the glass on the left and it looks significantly less than half of the glass holding the double. Now let's take an aerial view:



Hmm...they all look quite similar but one's a hexagon. Here then is the problem...a choropleth map is a container for data. Looking at a choropleth map is similar to looking down on a whole array of glasses filled with liquids of different quantities and it's impossible to make any sense of the amount of liquid...the totals are a function of the size and shape of the vessel in which they are contained. When the sizes of areas vary substantially the problems of estimating quantities gets even harder unless you adjust for the differences caused by the containers so you can make a sensible assessment of the relative amount of liquid in each glass:



In this example, the top left glass contains one shot, top right, two shots. Both these glasses are the same size so we have a consistent basis for comparison and the darker colour suggests more liquid...a correct visual interpretation. What about the big glass? Actually it contains one shot but because it's spread out across a much wider area the colour is diluted and it appears that the glass holds far less than either of the other two. This would be an incorrect assumption. It's the same as the top left glass and for us to interpret that correctly we need to see the colours the same. In map terms, we need to show similarity of the character of areas using similar symbols so our eyes and brains interpret things properly.


Let's be clear, this isn't some sort of quirky thing that cartographers do to finesse a map, it's not just 'best practice'. It's fundamental data analysis to support proper mapping of data. It's non-negotiable (and it's not even hard to do...). Your map will, quite simply, be utterly meaningless without your data being normalized.  

Consider John Snow's famous map of the 1854 cholera outbreak in Soho, London. His map is widely regarded as a classic. He mapped deaths as dots and was able to make an inference as to the potential cause of the cholera outbreak. If he had mapped the same data as totals on a choropleth the map would have been one of the most useless maps ever made; it's unlikely he'd have made any reasonable assumption about the mode of transmission of cholera or had the foresight to trace it to the Broad Street pump.  So why do so many people persist in making their maps useless? It strikes me as an odd thing to do but hopefully this little explanation will help those who can think about their mapping in a slightly different way.

Got it? Cheers, it was fun...





Monday, 26 November 2012

The Economist ponders map types

The Economist recently asked for reader opinions on the types of map used to portray the data it uses. It focused on the choice between cartograms, choropleths and proportional symbol maps.  I added comments which are reprinted below but you should read the original article here first.


Poor mapping gives the wrong message. Most are unaware of map theory so mistakes go unnoticed; misinformation is propagated. That said, asking readers their opinion is like a doctor asking a patient what medicine they prefer. The doctor has the conferred expertise to make a sound judgment.  The same is true here so my comments are based on my professional experience to add to the mix.

Population equalized area cartograms are impactful but difficult to decipher because of massive distortions.  We’re atuned to see our world in a particular way (normally through the hideously distorted Mercator lens) so when familiar shapes are further modified we struggle.  Numerous alternatives use circles, squares, hexagons and non-contiguous areas which gives choice.  I like cartograms but am used to them, know how to construct them and don’t have difficulty in deciphering the content.  They work best for global datasets where continents can be seen.  For headline grabbing infographics then a cartogram is hard to beat but one way of giving readers visual comfort is to add a second, smaller map using a more conventional method for comparison.

Cartograms rescale geography to account for differences in size of areas used to report data values.  If a conventional map type is used that maintains geography, this difference often isn’t accounted for and the map is worthless. The classic example is the choropleth that maps totals. Consider the number of medals that Team GB won at London 2012.  Greater London has a population of 8278251 with 10 medal winners (0.12 medals per 100,000 people). Cardiff has 346100 people and 4 medal winners (1.16 medals per 100,000 people).  A map of totals shows Greater London as visually dominant and Cardiff much less so when the reverse is true. Normalized results allow proper per capita comparisons across the map that account for underlying populations.  The classification scheme used is also vital as it can dramatically alter appearance. There are many choices (natural breaks, equal interval, quantile, standard deviation etc.) and each dataset requires exploration to avoid imbuing false patterns.  Choropleths are bland but they do their job. Make good use of other design principles to combine functionality with a useful aesthetic.  Your colours are poor. Green for non-export markets confuses and neutral grey would be a better choice.  You use light peach, through orange/pink to a heavily saturated red last seen during the cold war on propagandist maps! It’s visual noise. Adding Catalonia in burgundy makes it seem part of the choropleth spectrum yet isn’t. Good colours go a long way to making the map work. Legends are important to see the classification scheme but the map should be able to tell the headline story without one. All choropleths suffer from dominant large areas so where possible use an equal area projection; and inset maps for those parts of the map that contain small geographic areas.

Your proportional symbols are too similar, leading to the impression that exports are similar.  Greater variation in symbol size would help.  Transparency deals with overlaps but won’t always work where large data values occur in smallest areas. Colours could be improved and a neutral background would help with contrast. Humans aren’t good at estimating differences between areas.  How many people can accurately tell if one circle is double the size of another? There are ways to adjust for our underestimation but which introduces further complexity.

You might consider dot density, dasymetric  or, for this subject a flow map would suit.  Flow lines from Catalonia to neighbouring countries could be scaled by width to indicate proportions.  My rudimentary reworking of Minard’s flow map of British Coal Exports shows how flow can be represented. If you’re presenting maps online then consider hover and click events to reveal data values or additional information. This pairs back the map to essential graphics while allowing people to delve into the content interactively.

So the answer isn’t straightforward.  Consider each dataset independently of preconceived ideas about map type.  Think about the story you want to tell to inform your choice.  Once chosen, the next trick is to design it to work effectively and marry form and function meaningfully.  This isn’t easy and is the main reason why so many poor maps are made. Sometimes a table or a graph is much more useful.  Sometimes you might combine graphs with the map or combine map types. The map should be informed by a decisions that bring together useful graphic components in a well-thought out composition. There’s no substitute for looking at how others tackle thematic cartography. Learn what works, understand what doesn’t and your maps will evolve into purposeful products regardless of map type.

Wednesday, 15 August 2012

Does it matter if the map is wrong?

Dear @BBC_Magazine,
Today you had a nice little article online asking 'Olympic Counties: Does it matter where medal-winners come from?'. You even begin with the phrase 'A geographical breakdown of Team GB's Olympic success reveals some areas with more prizes than others'. It's a pleasant enough commentary on social and spatial identity and belonging and the way in which towns and cities across the UK are claiming association with Olympic medalists....and you point out in a very British way the error of most of this with facts about the real place where Andy Murray was born or how Yorkshire is in fact not a single place etc etc.

The trouble is...you go and spoil all that 'my county is more important than yours' with a map that fails in truly Olympian fashion:




Ollie O'Brien (@oobr) was astute enough to take a screen grad (thanks to him for passing it on to me) and pointed out the first wave of mistakes on Twitter (Aberdeen not being in Aberdeenshire; Plymouth not having a medal, Edinburgh in the wrong place etc).

The map seemed to be very rapidly 'fixed' with a series of iterations during the day.  On the one hand I applaud the BBC for taking note of Ollie's constructive criticism and making corrections rather than ignoring them. On the other...you've missed a belter of an error. Here is the map as it was still being shown by the following day...


You've gone and done it again...mapped raw numbers using a choropleth (BBC is developing a habit of doing this).

Mapping totals in this way is completely spurious.  You've got to adjust for the different sized areas and populations (normalise). Yes, London is a big city and Greater London has a population of 8278251 and 10 medal winners.  That's 0.12 medals per 100,000 people. Cardiff has a population of 346100 and 4 medal winnesr.  That equates to 1.16 medals per 100,000 people.  So the population of Greater London is nearly 24 times larger than Cardiff...it's therefore perfectly reasonable to expect (all other things being equal) that more medalists will hail from the Greater London area despite Cardiff actually doing far better in relative terms.  The point about the map is that to compare one area's medal haul to another requires you to modify the raw counts precisely to allow readers to compare them on a per capita basis.  As it stands your map presents a meaningless distribution.

Other than that glaring error... nice colours. Check. Clear labels. Check.  All going well so far but wait...this is an article about assigning medal counts to place of birth and yet you assign medals to the Cities of Aberdeen, Glasgow, Edinburgh and Cardiff and others to large counties and that's after citing work from Dr Garner of Aston university whose work makes clear that people's loyalties are much more localised (estates, areas and, at most, a town or city). You've used a nicely inconsistent mix of English county boundaries, Scottish council Areas, Welsh unitary authorities and Northern Irish council areas.  What happened to English unitary authorities? In fact what happened to Plymouth...it was shown as a unitary authority on version one without a medal, then it magically disappeared in version 2. Maybe a proportional symbol map centred on cities would have been a better approach to at least be consistent? While we're talking about consistency, are you labeling counties or cities? You label London yet shown the Greater London boundary.

So I re-did the map.  The map below shows the per-capita distribution on the left and whaddya know...actually London didn't do so well in relative terms.  I also fixed the issues with the boundaries so there is at least consistency.  And if you still insist on mapping totals, the version on the right maps the raw medal totals as a proportional symbol map.

So, BBC, you wrote an article about the importance of place and identity yet failed monumentally in using that most geographical of tools...a map, to illustrate the facts. In so doing you destroy any faith the reader has in your report and for those who don't recognise the errors, you perpetuate misconceptions through erroneous cartography.

Does it matter if the map is wrong?  Well, yes, particularly in an article about geography, place, spatial identity and where the basis of the discussion is about comparisons between places.

PS...Before someone cries foul that I didn't include Northern Ireland or the Isle of Man, Channel Islands or any of the 9 foreign countries that Team GB medalists hail from...I know...I'm sorry...I just didn't have the time or data to go to those lengths and all this blog was supposed to do was make a general point rather than build a perfect replacement.

Thursday, 2 August 2012

Mapping NBC Olympic Opening Ceremony coverage

There has been plenty of constenation about the coverage of the Olympics that US broadcaster NBC is subjecting US subscribers to. Given I now reside in the US I have seen first hand the abomination. It is truly the most excrutiating experience ever.  Delayed broadcasts, more ads than athletes, inane commentary and yes (though to be at least partly expected) an almost entire focus on US athletes.  I wouldn't mind the last of these because it is a US broadcaster after all but I'd have hoped for at least some coverage of other nations and sports that don't have a US medal hope.  Anyway, this is a blog about mapping so...

A couple of weeks ago I presented a range of simple thematic web maps I'd built for the 2012 Esri User Conference on medal hauls and competitor counts.  The purpose was really to demonstrate how to design and construct them using ArcGIS so if you're interested you can take a look here (and let me know what you think!).

I was also developing a map of the NBC opening ceremony coverage but Andrew Shears beat me to it (here) as part of a terrific critique of NBC's coverage.  The map he built shows the amount of air time given to each country during the Parade of Nations at the opening ceremony.  NBC's heavy editing seemed to present a somewhat unbalanced viewing experience and I too was keen to map the air time data.  Every country was subjected to some comment about their political status, struggles, crises, war and religious 'difference'.  Some of the commentary was not just ignorant but bordered on bigotry with commentators poking fun at country names, customs and such like (often mispronounced).

I show my version of Andrew's map below, illustrating those countries that received more 'air time' in darker shades using the same classification scheme as he did.  Andrew called his map 'NBC's Geographic Imagination' and as it stands it serves the purpose of illustrating how the US perceives the rest of the world.


So no surprises eh? Team USA and the host nation (Great Britain) get huge air time followed by Australia, China and then the rest of the world.  But just a moment...while I entirely concur that many nations were short-changed (particularly those eschewed in favour of ad breaks or those immediately after Team USA that were largely overlooked), looking at the total air time doesn't really tell the whole story.  While it is true that NBC controlled their delayed coverage and made editorial decisions about the time each nation was on air ('edited for an American audience' we are told), surely the number of competitors plays a key part in this metric?  Simply put, a nation with hundreds of athletes takes far longer to enter the stadium than a smaller one with only a handful.  This, then, is a great example of how mapping totals on a choropleth doesn't always reveal the story (though it does reveal a story).  Before I present an alternative, I re-classified the total air time into quantiles...



It's the same as the first map but just re-classified in terms of the categories each nation falls into.  Now, take a look at the following map...

This is a map of the total air time for each nation, normalised by taking account of the number of competitors to give air time per athlete.   It's classified using quantiles so it is immediately comparable (in visual terms) to the previous map. And what a different picture!

The map can now be viewed as a level playing field (pun intended) and on this basis, one could argue that NBC were actually rather generous to many nations in comparison to coverage of Team USA and the other well represented teams. Certainly, many African nations did well.  As you might expect, the main competitors in terms of the all important medal table (China, Russia) didn't do so well and competitors in certain disciplines (Australia in swimming for instance) also received less coverage.  So while there was a clear bias in some elements of NBCs editing, the map of total air time doesn't really tell the whole story.

That said, viewing the ceremony did leave one with a sense of foreboding as our brains aren't that good at working out relative proportions on the fly.  In that sense at least, NBC didn't do very much to counter the various accusations of bias and poor editorial judgement.

Finally, is a map the best way to look at this relationship? Take a look at the following scattergraph (which excludes Team USA and Great Britain as their large teams and large air time are significant outliers). Number of athletes is on the y (vertical axis) and seconds of air time on the x (horizontal) axis.


So we have a reasonable spread and there is some sense of a positive correlation (albeit a weak one) that shows the proportion of air time broadly equates to the number of athletes where a nation has over 100 athletes.  But look below that 100 athlete line...there are dozens of nations receiving a lot of air time with relatively few athletes. So in this sense the scatter graph at least supports the notion that a map normalised by competitors at least tells a more realistic story.

Just another example of how maps can mislead the innocent.