Sunday, 17 May 2015

Helecxagon mapping

Two things happen whenever there's an election. First, politicians wander round spouting rhetoric in an attempt to persuade us that their colour is the one we should care about. Second, cartographers and map-makers everywhere develop a palpable sense of excitement as a new national dataset is quite literally born overnight. From a cartographic perspective, the recent UK General Election didn't disappoint.

Politically, the Conservative's couldn't have imagined such a result; a majority from seemingly out of nowhere and against all the polls. Labour were trounced and no more so than in Scotland where the Scottish National Party all but turned the map from red to yellow. The UK Independence Party did well in vote share (12.6%) but this translated into only one Parliamentary seat.

For those unfamiliar with how a UK election works, Great Britain and Northern Ireland are subdivided into constituencies. The population of each constituency get to vote for the person (standing on behalf of a political party) they would wish to elect as their Member of Parliament (MP). The votes roll in, are counted, and the person with the most votes wins that constituency 'seat' in Parliament on behalf of their party. There are 650 seats overall and the party that gains a majority of seats gets to form the government as overall winners. So, the party that reaches 326 seats wins. There's a lot of complexities if no single party gets 326 seats but let's not get into that...this isn't a political blog.

So the result was fascinating in and of itself but let's get stuck into the cartography...

Back in 2010 at the last UK General Election most news agencies went with a standard geographic map showing the results by colour of the winning party.

The trouble with this approach is that larger constituencies dominate the map in visual terms. Smaller, inner city constituencies can hardly be seen on a national map like this. It distorts the way we see the election results. On this map there's a lot of blue and a fair bit of yellow and gold. Not much red.

Alternatively, cartograms offer a form of thematic mapping that accommodates the difference in size of areas. There are plenty of alternatives. The Gastner-Newman population density equalizing cartogram tries to preserve some sense of geography while squeezing and stretching shapes. It appears a little odd to some people. The DeMers uses squares, the Dorling uses circles; both perfectly good shapes and then...there's the hexagon. Here's the 2010 results again, this time mapped with equally sized hexagons.

The colours are now equal in terms of the area they occupy on the map. The gold and yellow in the large Scottish constituencies have receded. The blue has also been shifted in visual importance as many far smaller constituencies that elected a Labour MP (red) are now visible. There was a hung parliament in 2010 and the Conservatives (blue) had to do a deal with the Liberal Democrats (gold) to get over the 326 seats needed to form a coalition government. The map in this form is a much more useful mechanism for communicating the results for this specific data. It tells the story far more effectively than a geographic map.

Hexagons have been used as a framework for mapping since at least 1895. They were also promoted by Danny Dorling in the 1980s as a method for mapping election results because they are close to circular (and thus pleasing on the eye) and they tesselate well, providing flexibility and six shared boundaries each. Dorling noted this was a pretty good fit for UK political geography. Oxford University recently published a blog reminding the world of Dorling's work prior to the recent election.

Sporadically, news agencies have used hexagons but this year the hexagonal cartogram went viral. Virtually everyone used them. In fact, you'd be hard pushed to find a news agency or media outlet that didn't. Andy Kirk even proposed a new name - the elecxagon map which struck me as a fun way to refer to them in this context. I modified it a little more - 'helecxagon'. So let's take a look...

The BBC got the 6 sided ball rolling with a giant physical map they built in the piazza at Television Centre. A map you could walk on. A map that had tiles added throughout the night as results came in. A map that was used for short interviews with virtual nobodies and which they panned across as they went to new bulletins. A map that was, well, rather under-used. Shame. It's almost like they didn't really know how best to use it as part of their broadcast.

BBC piazza election map

The BBC web site (and many of their other digital mapping) curiously did not go for hexagons which they had used successfully in 2010. An odd decision and with their under-used giant hex-map they dropped the ball a little in mapping terms.

Others filled their boots as the results rolled in and web maps began to be coloured in. The Telegraph used a hexagonal cartogram, as did Sky News

Sky news web map

The Telegraph election web map

The Independent went with a hexagonal cartogram too...but the web page opens with the geographic version and there was an option to switch to a geographic version if they wished.

The Independent web map

In their print media, The Independent preferred a geographical view and they also offered a slider comparative view comparing the 2010 with the 2015 results on their blog...again, geographic.

The Independent print version

The Independent 2010/2014 comparison slider

Bloomberg also gave visitors to their web site the option of a geographic or a hexagonal cartogram. What I particularly liked was the way that the map transitions between geographic and hex through animated proportional hex symbols. Largely meaningless, they did provide a subtle visual link between the abstract hexagons and the real geography. Using a transition gives the eye something to follow and it's arguable that it aids our interpretation of where places are in relation to one another.

The transition state of Bloomberg's web map

Bloomberg also had a fun animated map by Julian Burgess and Adam Pearce who used a blank canvas with no boundaries of any form, across which splodges of colour were fired. The results are animated so a map of colour builds during the 25 seconds that the animation plays. It's a piece of visual data art and one of the more interesting approaches to mapping the data. There's no way you can recover the results or explore the data but that's not the point. It's exists because they had a good idea. It works.

Ollie O'Brien produced a live map for election night that updated the results. He has since made a few post-election maps showing various metrics such as swing in share of vote, turnout etc. Plenty more discussion on his blog and a link to a web map featuring the various layers here. Ollie went for a geographical view of the results and multivariate proportional symbols.

Swing map by Ollie O'Brien

Ben Hennig couldn't settle on a particular style so went with the option of providing three versions on his maps of the results. He illustrates the geographic, hexagonal cartogram and a gridded population-equalizing cartogram side-by-side. You get three maps for the price of one with Ben's work and if nothing else it's a good way to show the different trade-offs between map type. More detail on Ben's blog and his continuing work with Danny Dorling in developing cartograms.

Three-in-one map by Ben Hennig

In my opinion The Guardian provided the most compelling and complete cartographic service on the night itself. A map that was coloured in as results came in, that auto-zoomed and panned to a constituency you could search for or click on. The live election headlines scrolled next to the map and they to were geographically enabled so clicking on the headline brought up the results for that place.

The hexagons showed regional boundaries and constituency boundaries, hover the mouse and you got some basic detail. Click and you get more.  More than that, you could switch between the overall map showing the winning party (using the traditional colours) to a map that showed majority, turnout, and vote share by party. While still using the basic cartogram, these maps used transparency (as an unclassed choropleth) and proportional symbols (arrows) well to convey the message of the different election metrics. Lots to interest both the casual reader and those more interested in digging a little deeper. Supporting graphs and tabulated results as well as subtle labels added to the overall approach and usability.

The Guardian general web map

The Guardian vote share for Conservatives web map

The Guardian turnout web map

The Guardian swing (here, to SNP) web map

And so, after the serious maps come the frivolous. There were plenty but these are the ones that caught my eye.

It soon became clear that the Scottish National Party were sweeping Scotland with a swathe of yellow constituencies. With much of the rest of England and Wales being coloured blue or red, the comparisons with Maggie Simpson began proliferating our social media feeds.

Vaughan Roderick compared the final map with a quick sketch of traditional coal mining areas of the UK. These traditional industrial heartlands are staunch Labour areas and so the visual correlation between the red of the map with areas of strong support for the centre-left party are a natural fit. The approach gives context though and helps to lift the lid on why the map is coloured as it is. Of course, voting behaviour is far more complex but this was a useful way of reflecting on some of the historical and geographical reasons for the patterns.

Combining a cartogram with the beauty of a hand-made 'physical' map, Tom Katsumi opted for a cross-stitched version, adding a stitch as the results came in to colour in his cartogram based on squares.

Finally, my colleague Craig Williams even built his own map using giant building blocks...all four of them, some days before the election. Given the result, he was remarkably close.

And what of my efforts...they're coming along nicely. I have been making two interactive maps. One an artistic effort and one built from the ground up using 3D hexagons (I'm calling them hexstones). I wasn't intending to make the maps live on the night. Instead, preferring to work on the full results after the election and taking the time to make the map I want to make.

For the 3D map I went for hexagons because I've spent years making 2D cartograms...and I wanted to tackle the technical challenges of making tesselating hexagons on a 3D, spherical world. There's also a natural metaphor with the Giant's Causeway in Ireland and part of my inspiration was this picture of David Cameron taken last year.

My 3D map as a work in progress

The artistic one was partly inspired by the Bloomberg one but I want it to also reveal the data. I'm calling it a splat map.

My splat map as a work in progress

The election was fascinating. The cartography of the election was perhaps more fascinating if you're interested in maps (and if you've read this far I'm guessing you are).

It's pleasing to see the rest of the world waking up to the value of cartograms and, in particular, the hexagon though I wonder if there will be a backlash at the next General Election? Will everyone stick with the hexagon...or twist and search for something different that tries to set them apart. By the time of the next election there will undoubtedly be a raft of new technologies that may help or hinder as well.

Saturday, 28 March 2015

Needless lines in the sand

I just read a blog post from Andrew Hill, a guy whose work I admire greatly, entitled In defense of burger cartography. Go have a read if you've not already done so then come back...I've got a few things to say.

I've been quite vocal in my annoyance with many so-called new cartographers and their general fancy for creating needless dividing lines between their self-defined fresh approach and pretty much everything that ever went before. They tend to eschew previous thinking, research, technologies and people and view this as a huge positive. I'm afraid I read Andrew's blog in very much the same vein so here's a few quotes I've extracted that I'd respectfully like to contest:

"time to fall in love with maps again"
You'll likely find most of us never fell out of love with them. Is this perhaps just a rallying cry to further support the belief that all this new stuff is unequivocally super awesome? Cartography has always been great. I'm glad so many are finally finding it too but c'mon...join the club, don't try and start a new one.

"what I'm seeing has never been talked about before"
I'd strongly refute this observation. Most of what I see has been done before and has been talked about before. It's more likely that the people who offer this view simply aren't familiar with what's gone before or don't care to look beyond their own limited experience. Sure, technology is evolving and there's some new ways of making maps but largely we've seen it before in some shape or other. What is perhaps true is that many weren't around when it was done before but we have books and such like to reference. And why is it that people like me pipe up with blogs? It's precisely because we want to expose these very same people to stuff some of us already know. That's not being's about knowledge transfer and sharing. It's why I enjoyed being a lecturer for so long and why I now enjoy teaching about maps from within a different type of organisation. It's also why I wrote a daily blog last year to expose people to stuff they may not have seen before. The trouble is that it's a two-way process and does require people to want to learn and I'm afraid I find far too many who simply think they already know it all. None of us do. And the other reason why many perceive that so much hasn't been talked about before...because they don't inhabit the same places that many others inhabit so there's an immediate disconnect. I rarely see new-mapmakers at any of the established cartographic conferences where much of this stuff has been talked about for years (actually, NACIS in the US tends to buck this trend and to be absolutely fair to Andrew I did meet him at a NACIS conference a couple of years ago). But more mapmakers tend to inhabit a world of meetups and hangouts and don't go to where cartographers have historically tended to hang out. They are unlikely to be seen at the International Cartographic Conference for instance and that has to be by choice. Wouldn't it be so much better for us to all meet in the same sort of places where we can share knowledge, research, learn some rules and break some others? I know many of the established conferences and other meetings have been very keen to embrace new map-makers but take-up has been low. By the way...this year it's in Rio in August...maybe I'll see you there along with 1,000 or so other people who love maps?

"maps shouldn't remain difficult to create just because old school software hadn't been brought up to speed with modern technology"
Another fallacy. I recall a fantastic piece of software called Atlas Mapmaker I used (and taught with) for thematic mapping in the early 1990s. It was brilliant. I used it alongside Arc/Info and IDRISI. Each brought different things to the table. Sadly, Atlas Mapmaker is no more but other software has come and gone in its place and I think it's wrong to suggest there's a divide between old school software and other newer software. In the last 5 years more mapping software has come along too. So what do we class as 'old school'? I'm guessing this is a reference to software that's been around a fair while but look through the history books and you'll find it morphs, changes and updates regularly. It doesn't just keep pace, it sets standards. Yep, every now and again something new pops up and offers something a little different but I'd suggest that those who like to bash the so-called old-school software likely have never properly used it; they likely prefer to hate for hating's sake; and more than anything like the idea of being seen as new and exciting alongside something they proclaim as new and exciting. Let me put it like this...if you're SwissTopo there's software you use and software you don't use. Journalists might prefer a different approach. It's all fine and as I've said before I use many different pieces of software to make maps and don't feel the need to define and demarcate how I make maps by buttonology. After all, software is a tool that helps you get something done. Without knowledge of concepts, practice and a strong appreciation of the rich tapestry of cartography you're going to have to be pretty lucky to hit those buttons correctly enough to make a decent map. Maps have never been difficult to create. You just need time to figure out how to make it and what's going to help you make it. Knowing something about cartography gives you way more than the tool you use to make the map. It empowers you to know what you're doing, how to design and, crucially, which rules you are able to bend and break more than others. That said, yes of course we should expect modern software to take advantage of modern technology and it should also push what's possible. If I still had to use PC Arc/Info 3.4D to make maps I'd suggest we've not progressed very far. Except it has progressed. So has every other piece of software too.

"goodbye old world"
Why? If we always threw away what went before we'd be in a scientific and artistic wasteland. Build on the past and embrace the future would be my preference.

"people often get self-referentialy dogmatic about some previously decided laws of cartography"
I'm guessing I'm included in this accusation. Saying that rainbow colours are poor choices on some map types or that it's important to normalize data on a choropleth is neither self referential or dogmatic. It's fact. It's in books. It's based on research. It's the sort of established practice that helps us make better decisions when we make maps. That's all. No-one ever called them a law. It's called best practice and the reason I bang on about it is because so many people don't get it. Sure, lots of stuff can be challenged and that's fine but let's not set out to decry the essence of well established, useful knowledge and understanding. There's a language to graphicacy that has evolved and helps guide us regardless of what our individual motivation for making a map is.  And while we're on about rules and conventions here's where I get a little confused. Many new mapmakers make their maps using code. Now those who know me know my coding skills are not what they used to be and I'm impressed by people who want to code their maps and who do so. Code requires rules and conventions. If you don't follow the rules and conventions your code will likely not work or perform poorly. If everyone ignored the basic rules and conventions it'd be anarchy and you'd all be calling each other out on github over rotten, unusable and unhelpful code. There's a practice; a syntax; a best practice to writing elegant and purposeful code. Of course, not all code is written equally just as not every map is made the same, but whether you want to call them laws or simply see things as best practice it helps to have guides. So I wonder why the sort of people who are happy to abide by general rules that govern coding in a particular way seem more than happy to tell us that cartographic code, rules and best practice are simply there to be broken. If that isn't double standards then what is?

"like many other fields, cartography is changing fast"
Sure is! But what exactly is this change? Conventional commentary suggests it's that technology allows us to do more, more easily. But is it easier to make maps than before? Let me go back to Atlas Mapmaker...I could make a map in minutes using that from a simple text file out of Excel. Sound familiar? And that was over 20 years ago. Sure, now we have the web as a place to make maps but I think what characterizes the change in cartography isn't the's the people. More people make maps now. It's not just cartographers. It's everybody. It's fantastic. Let's not change cartography because, frankly, I don't believe it needs changing. Let's evolve it...together. What seems to be changing faster than anything is the number of people who seem intent on redefining it for little or no reason.

"the dogma of cartography is certain to be overturned by new discoveries"
I hope not. I hope that it's challenged and it evolves as it has done for centuries but why is everyone so hell-bent on revolution? Yes, people can explore cartography but it's not because they are doing so "outside the bounds of comfort for traditional cartography", It's because they are either unaware or not bothered to engage with it before they make their map. Of course new ways of seeing, talking about and doing cartography will come about because people have a natural desire to experiment. That's not the preserve of people new to map-making either. If I made every map the same I'd be bored to tears but if I come up with a new way of seeing a theme or how I wrestle with symbology or whatever I see it as adding to the mix...not as a way to overthrow cartography altogether. There's probably not a week goes by when I don't see something a little bit new...but rarely something that makes me reconsider the very nature of cartography itself. So why do some wish to set out to seek a way of destroying cartography with the implicit belief that new has to be better?

"welcome on board the journey for the new world of cartography, your old world criticism has missed the boat"
Probably, because no-one likes criticism and I'm acutely aware that everyone hates a critic...particularly one with opinions. Worse, one with opinions based on some understanding of what they're talking about. I'll likely get heat for this blog too and be painted as just that grumpy guy who thinks all new cartography should be immediately burned at the stake. The truth couldn't be more different. I embrace new stuff but it doesn't mean everything is awesome right? It's getting harder and harder to even suggest that something doesn't work and that's a problem generally and not specific to cartography or map critique.  Most people don't actually understand the role of critique anyway. They seem totally unable to separate a critique of their map from some perceived personal attack or unwarranted and unsupported criticism.  If I wanted to have a pop at someone I'd probably do it Jeremy Clarkson style (I never have by the way...). If I have something to say about your map I'm talking about your map and not you.  I may do it in a way that you don't care for but it's about the map, not the person and by the way, I enjoy people commenting on my maps because it makes them better.  Making a playful map shouldn't absolve it from critique anyway and the intent is not to provide critique as a way to reinforce established values. It's to provide a critical eye on what the author claims or what the technique claims...or more likely what the author claims about the technique. Does it hold up for instance? Yes, they often capture attention (because they shout very loudly) but dig a little deeper and they often hold little more than fleeting fascination. If critique is perceived as in any way negative then it's all too often explained away as a result of the guy offering the critique as being stuck in the past. Really? There's a chilling arrogance by far too many who seem unashamedly unwilling to learn anything from people who have been there and done it (I can see eyes rolling at the mere mention of that) or that critique is a valuable way of debating claims and techniques. But it's a sad state and it's spreading beyond the map and into map education. Even this week I was left totally bemused that someone (who I won't name) was openly proclaiming they had a eureka moment about something you'd likely learn in any high school geography class. And this person is paid by a mapping company to teach about geo and making maps. They self-proclaim they want to help people learn but frankly the evidence suggests they need to do some serious learning first. It's frightening. They are literally telling the world across social media that they know nothing about the very thing they profess to know everything about. And worse...there's an awful lot of people who gravitate to this type of person and mindset. Our whole basis for education about mapping and cartography is being challenged because the hacker mindset is now being extended beyond simply making maps to decrying any sort of formal education in geography, let alone any of the related mapping sciences. Is this how we want people to learn about mapping? I sincerely hope it's just a blip and sense will prevail because currently the world of new mapmakers is learning very little from other new mapmakers who know very little....and the more the new order creates this self-fulfilling agenda against a perceived 'old cartography' the less people will ever know or learn. Take a class. Take a MOOC. Attend workshops delivered by mapping societies and organisations. Search out any number of educational institutions who can point you in the right direction. DM or email me if you want any pointers from me.

"I think the Twitter maps are spot-on and achieve their objective better than you can imagine"
Twitter maps...nope,  I've made them myself. I've researched and published on their design and so on and I've used an awful lot of imagination but lots of flashing lights don't make a map that tells me anything. It's not the mapping that's necessarily the problem, it's the data and it's so full of holes that even if you put 35 million tweets on a map it doesn't cover up for the woeful bias, uncertainty and inability to make any sense of them. Technologically putting them on a map is a feat of engineering that is true but as a useful dataset or something you can visually make any sense of they fall short. And what's the objective anyway? I only ever see vacuous, unsubstantiated claims about what this or that map reveals. They don't. They really don't. Clarifying their real objective would be a good start. Finding a better use for animated flashing maps would also be useful. Making maps of millions of pieces of twitter drivel flashy simply gives me cognitive overload and short-term inattentional blindness and hinders change detection. Adding multiple colours for no apparent reason makes things even worse. Part of the art and science of cartography is taking lots of bits of information and wrangling them in a way that reveals something useful. Using a map as a canvas for a visual data dump doesn't work. It never has. Data art yes...a map. Not yet. And should such maps be immune from critique on the grounds that they are allegedly new and challenge cartography? I'd suggest these are the very maps that require critique to establish their real value.

"this is all a bit too handwavy for your quantified mapping practices"
Pitching some of us as quantifiers of mapping practice and others as do-ers; and marking the former out as old-fashioned and the latter as embodying the future is quite absurd. In that taxonomy I'm firmly labelled as one of those old-school quantifiers who prefers dogma. But then only yesterday I finished up a map that fits squarely within the mantra of exploratory playfulness and which challenged my own ideas. It was made way outside what you might call standard cartographic principles but it was made with a very clear understanding of the extent to which I could bend the rules. I worked with them, not against them...and I waved my hands a hell of a lot. You can't have it both ways. Yes, some of us have a professional history in the discipline that seems to mark us out as archaic buffoons from yesteryear and yes, many new map-makers don't have that history. I don't have a problem with that because the sand box is big enough for all of why the hell is there such a pressing need to want to be different and so distinct from anything that ever went before? I'll continue waving my hands like I just don't care. Every now and again it'd be lovely to read that some new mapmaker made a new map and said you know what, I saw this technique on an old map, read about it and built off it.

"I'm ready to learn"
Yes. So am I. I learn every day. I'd like to see many new map-makers do a bit of learning too. Learn that they're perhaps not as new as they think they are and that so much of what they say makes them look, well, rather immature to say the least. Perhaps learn a little humility too. I don't care who you are but if you're in your early twenties you cannot know everything. I'm double that in years and I don't know half of what I'd like to know. There's scope to learn every day and if anything, life as an academic taught me one very important's not necessarily about knowing everything; it's about knowing what questions to ask, when to ask them and of whom to ask them.

"Get ready to fall in love with mapping all over again"
Nope. I'm already in love with mapping. Have been for more than 40 years. I've seen a lot of change and new stuff always interests and fascinates me. I've no need for people new to mapping to portray this point in the history of cartography as so fundamentally new that we all need to re-boot. If it serves to justify how you like to be seen, as different, fresh and avant-garde then go ahead. I've seen more people than I care to remember herald the new cartography and ultimately it just adds to the soup. Of course there's new stuff...there always will be in a fast-paced technologically underpinned area such as cartography. I get as excited as the next person with the ability to create incredible looking work and thinking up ways of harnessing new technology for making maps. There's some incredible stuff going on but there was last year too...and the year before that...and ten years before that...and in the early 1900s etc. Carry on being in love...don't discard your previous lover because you think you've found a shiny new one.

I've said it before and I'll say it again...lines in the sand are unhelpful. Some of us are professional cartographers, some of us are amateur map-makers. We're different but we don't have to be divided by rhetoric. Some of us have a formal cartographic education, others have backgrounds in biology, computer science and journalism. For many, the emergence of tools they've gravitated towards have allowed them to make maps they want to make. Some are good. Some are crap. That's life. Some people who purport to be cartographers also make pretty shitty maps. I have made some shitty maps too.  Most of my favourite maps of all time were made by non-cartographers. And before you start mocking old-school technologies you know there would likely never be any new technologies without their existence. Plenty of people use them perfectly well so let's not start fighting because you think I use a crayon and you use a Macbook Air.

I disagree with much of what Andrew said in his blog and I hope he appreciates my right of reply and takes it in the spirit of conversation. As for his maps...shit they're good and he's a talented map-maker. We need more of his sort. Some people like my work too...and it's conceivable the same people might like both our work. Don't shout that too loud though eh?

Update: I'd recommend this excellent blog by Taylor Shelton who picked up the threads in this and Andrew's blog. He makes some very reasonable and pertinent comments about the value and purpose of critique. He also suggests it's not really about getting people to love maps but, rather, that we should get people to take maps more seriously. I agree. I also feel that this idea of rejecting established cartography in favour of playful exploration is really just an excuse for not applying thought or intent to encode, reveal and communicate meaning. James Cheshire also offered some thoughts on his blog and I particularly like his last comment that "[cartography] doesn't need to take the short term view and compromise its standards to remain relevant"

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'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 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

Tuesday, 24 February 2015

Messy heat map

My last blog post on heat maps was an attempt to persuade map-makers that the term actually means something other than what you might think it means...and that doing cluster analysis of some form or other on your data more than likely requires a better understanding of data and technique than a so-called heat map generator provides.

My Twitter feed lit up today as Manchester City played Barcelona in the Champions League Round of 16. Lionel Messi, the Barcelona forward, had a fine game by all accounts (to be fair he pretty much always does) and Squawka were on the ball with their live analysis during the game.

Squawka provide a web-based view of sport that collates and presents data as it happens. They tweeted the following:

Needless to say it brought on a nervous carto-twitch. If you read the previous blog you'll know by now that whatever the above is, it's not a 'heat map'. It's a density map of some form of cluster analysis but it illustrates far more than just another example of an inappropriately named map.

Here are some of the issues I see with this map and how similar issues are seen in almost all of these sorts of maps. They may help to understand that it isn't, in fact, a map of Messi leaking all over the pitch.

What is the data that was used?

Messi presumably ran about the pitch yet the splodges look like they are based on point data. Is this where he had the ball? Where he received the ball? Where he passed the ball to another player? Where he was stationary for a period or simply where he stood watching as Suarez scored the goals? Etc etc. While logic suggests that a map of Messi's running should be linear we are immediately confused in trying to decipher what this data actually represents because it looks like points that have been analysed to create a representation of clusters (more points = larger or more intense splodge). Without knowing what data the map represents we cannot decide whether he was all over the final third or not. If the data is indeed points then is that an appropriate metric and can it justifiably be used to show what they purport the map to be showing?

What are the fuzzy splodges?

The typical symbology on these sort of maps tends to go through some form of spectral colour scheme and this is no different. The hazy blue splodges are likely where less clustering occurred but is this a fleeting movement or pass or where he tripped over his laces? As Messi moves more or passes more (or whatever more) the intensity of the symbology increases. But what precisely does this represent? We have no legend to tell us what changes in colour mean and whether colour is mapped onto the clustering values linearly or logarithmically or...

Indeed - if you look at the overlap of two hazy blue splodges near the bottom centre of the map you'll notice that a simple overlap at the edge of two hazy blue splodges results in a bright, intense change in symbol. But if these hazy blue splodges are built from point data (presumably at the centre of the hazy blue splodge) then the overlap is simply an artifact of overlapping symbology...not necessarily overlapping data. These artifact overlaps occur everywhere on the map so it's unclear what the relationship is between data and symbology and how that then translates to Messi's actual movement or involvement.

The statement of being all over the final third also doesn't exactly stack up either. The main splodges are in a zone towards the top of the pitch graphic...a little left of centre but certainly not all in the final third. We'll assume Barcelona are attacking the left half of the pitch graphic and that even though teams switch sides at half-time the graphic maintains teams in the same half for mapping purposes.

All in all it's a graphic that reveals very little except gross error and uncertainty and which is utterly impossible to interpret in a way that reveals anything sensible about Messi's contribution to the game. 

These sort of back of an envelope 'heat maps' are unhelpful for any visual or analytic task. Quick to produce yes, but you can't make any sensible or quantifiable interpretation. Finally, we have no-one elses maps to look at so we simply have to presume that every other player's heat maps are in some way visually inferior to Messi's map.

Messy data. Messy clustering. Messy symbology. Messy map. Messy communication and very messy ability to interpret, compare or understand. Poor old Lionel Messi who is, quite literally, an innocent bystander in all of the map, sort of, shows.