Friday, November 05, 2004

The 'Purple Haze', revisited.

[Update: Nov 8]: More color schemes (one based on colorbrewer.org) and a toolkit to make your own maps !

By now, Robert Vanderbei's purple map of the voting counts in Election 2004 has crisscrossed the internet several times. On his web page, he answers some questions about these maps:
Can you warp the counties so that each county's area is proportional to its total vote count? Such warped maps are called cartograms. There are already several of these at the state-by-state level on the web. I haven't seen any at the county-by-county level. A few years ago I collaborated briefly with David Dobkin and Stephen North on algorithms for producing cartograms. I can say that making a cartogram with so many individual elements (counties) would be very difficult.
Cartograms are indeed hard to compute: this is an interesting geometric problem, as Jeff Erickson also points out.

As it turns out, the place I work at does cartograms, and quite well at that ! Stephen North (the one mentioned above) and colleagues have developed methods for computing cartograms and I used their approach to create a cartogram of the election results. I used the data from a paper by Daniel Keim, Stephen North, and Christian Panse that uses the medial axis to construct a cartogram.

[UPDATE: the original maps had a problem in labelling Nevada because of a mismatch between county names in the two data sets: the new maps shown here reflect the correction. Thanks to the commenter who pointed this out.]

I used a variety of color schemes: for more information, and larger pics, see my new cartograms page. (note: for formatting purposes I used HTML to scale the images; if you download the image, it will be bigger)

  1. A Vanderbei-like color scheme, where the relative proportion of votes for Bush or Kerry turns the county red or blue respectively: purple regions are roughly even.



  2. The winner-take-all color scheme: a county that Bush won is marked in red, and one that Kerry one is marked in blue.


  3. Red-blue (suggested by a poster on the blog). Start with a baseline of white for equal vote-share. as the vote percentage for the winner increases, increase the strength of red or blue appropriately.



  4. Grayscale (suggested by Kathryn Myronuk). Start with a baseline of white for equal vote-share. As the vote percentage for the winner increases, make the color grayer.


  5. ROYGBIV (suggested by Kathryn Myronuk). Again, white is neutral, but go towards the R side or the V side of the color spectrum depending on who wins and how much (thresholds at .7, 0.6, .53)




It takes a while getting used to a cartogram, and having to ensure that counties still touch after being inflated can make the problem quite difficult to solve while still retaining an overall representative shape. However, it is interesting to see how large California and the North-east really are in context, and how the entire middle-west of the country shrinks.

As far as I know, the complexity of computing a cartogram (where the typical formulation would be to minimize some error metric on the discrepancy between the area of a region and weight associated with it) is unknown, and is probably NP-hard (I once thought I had a proof for NP-hardness for rectangular cartograms, but it foundered). However, much of the challenge in cartogram design comes from trying to balance accuracy and aesthetics; the map when distorted should still look like the original map !

For more on this, check out the AT&T Info Viz page on spatial data transformation.

41 comments:

  1. You know about van Kreveld and Speckmann's recent paper on rectangular cartograms, right? http://www.win.tue.nl/~speckman/papers/RectanCarto.pdf

    D. Eppstein

    ReplyDelete
  2. This map looks pretty cool. However, your message is to show how the vote by population/county is represented, and the black state borders are a bit distracting. If you can change them to either white, or to the same weight as the county borders, I think it will make a cleaner map.

    ReplyDelete
  3. one thing I find interesting, the cartogram gives me the impression of being 3d. it's partly the coloring, partly the density of the border lines, and partly my familiarity with the shape of the US. it's not clear to me that my intuitive perception is giving me an accurate idea of the data.

    also, the dense texture of the red near the middle keeps suggesting to me the density of metropolitan areas, while the broad swaths of blue on the coasts gives me the impression of sparsely populated rural areas.

    maybe this effect would go away if each county area were broken down somehow into small identical elements, like squares or dots.

    -- Felix

    ReplyDelete
  4. To save some typing, I will point you to the post I made in a forum about this map.

    http://www.itsallpolitics.com/viewtopic.php?t=1023

    ReplyDelete
  5. Can you imagine Dan Rather trying to explain these maps to a TV audience?

    ReplyDelete
  6. Good work on this; really fascinating use of scientific visualization.

    ReplyDelete
  7. The cartogram is fabulous, but the data for Nevada, at least, looks wrong in comparison with Vanderbei's and other county-by-county maps... maybe I'm missing something?

    ReplyDelete
  8. The data for MA in the purple map is also wrong.
    (It shows it has having split 50/50).
    Based on pixel-weighting of the purple map, the overall
    vote would have been 44.85%/55.15% which is fairly far
    off. I'm not sure if MA alone is enough for this
    discrepancy, but it looks like parts of NY may also
    be incorrect.

    As a side-note, I find that saturation maps
    make things much more clear than the purple maps.
    (Coloring where 50/50 is white and 100/0 is blue
    and 0/100 is red and 49/51 is a faint pink while
    25/75 is a fairly solid pink). With purple, it
    is very hard to visually tell what where the balance
    point is. The MA discrepancy came out of trying to
    remap the colors to this scheme.

    Is your source data and code available?
    I've been thinking that it would be interesting
    to see a cartogram weighted by fractional GDP
    or Federal Tax Revenue rather than population.

    Thank you for pulling this together. The cartograms
    are much more useful than the geographic maps.

    ReplyDelete
  9. That's a great map. However, those votes aren't all counted equally. What would be interesting to compare those maps with, is one where the individual votes were divided by the number of electoral college votes that they represent. The counties in the least populous (sp?) states would end up counting more than they do now.

    ReplyDelete
  10. I find this kind of thing fascinating. I can imagine machines/algorithms becoming powerful enough one day that we can have dynamic morphing between geographic maps, cartograms, and other representations as the user makes selections.

    I’ve been experimenting with an approach to this kind of thing that proportionally represents relative numbers of votes while trying to preserve geography: http://www.averdevelopment.com/election.

    ReplyDelete
  11. This comment has been removed by a blog administrator.

    ReplyDelete
  12. One thing, as a cartographer, that I would recommend is that you pick a different bivariate diverging scheme than the red/purple/blue that you're using now.

    I am from PSU Geography, where we are lucky to have Cindy Brewer - a professor of cartography that has spent much of her career figuring out color schemes and issues related to perception and map use. She created a great tool called ColorBrewer that generates bivariate and univariate schemes for choropleth maps like these.

    http://colorbrewer.org/

    I'd love to see someone use one of her schemes on one of these cartograms or bivariate choropleth maps.

    Also, if you're interested in visualization and geography, please check out:

    http://www.geovista.psu.edu/ - where I work on exactly those issues. Stephen North knows a lot about us - he was here last Spring to give a talk and see our latest stuff.


    Anthony Robinson

    Research Assistant
    GeoVISTA Center
    Department of Geography
    The Pennsylvania State University

    ReplyDelete
  13. I really like the variant color mappings -- particularly the 100/0=red, 50/50=white, 0/100=blue -- but as interesting as cartograms are from one perspective -- they're damned hard to read, in small sizes.

    I'd like to have the cartograms of each color scheme alongside simple colored maps of the same scheme -- optimally maintaining the same county-level (or lower) granularity.

    And thank you for posting these.

    blogger-election@macted.com

    ReplyDelete
  14. As much as I find the warped cartograms interesting, it's too easy to lose one's place, since a state's shape is so fundamental to its identification.

    I have a suggestion for representing the electoral vote by state, in a way that preserves the actual shape of the state and doesn't blend the red and blue shades.

    Try modifying the intensity (saturation) of the color by state so that red (Bush) states are red and blue states are blue, but states with fewer electoral votes (or popular votes cast) are lighter in shade ranging from very light red (or blue) to intense red (or blue).

    Use some kind of color ramping for Kerry states (or Bush states) to vary from nearly white for states with few electoral or total popular votes cast to intense blue (or red) for those with the highest numbers. Yes, the spatial size of the state would have some visual exaggeration but the effect would be lessened.

    An interesting skew lies in how electoral college votes are divied out: every state starts with two (one for each senator) and then gets a piece of the pie based on population - possibly a significant advantage for low population states (which tend to be red).

    Another interesting view would be a map that illustrates the proportion of a state's population of registered voters to its actual turnout.

    ReplyDelete
  15. That's a nice looking map, but it's got accuracy problems. Disproportionately small for their states are: Clark Co. Nevada (Vegas), Hennepin Co. MN (Mpls), Indianapolis' county, Hamilton Co. OH (Cinci), Philadelphia, and Dallas TX. Also, Manhattan, the Bronx, and Boston should be dark blue, and there's no super-red spot in downeast ME.

    bittern

    ReplyDelete
  16. now matter how you look at it: Kerry is still a loser!

    Komrade Kyle
    http://CommunistsForKerry.com

    ReplyDelete
  17. These look nice! This website has a bunch of other election cartograms: http://the-raw-prawn.blogspot.com/2004/11/alternate-views-of-electoral-map.html

    ReplyDelete
  18. Some great maps here! Am happy to see the proportional ones.
    I made my own map of the states votes by population in photoshop using precise mathematical values for red and blue in order to show (and annotate) all the ranges of purplish-blue to purplish red. (We are NOT a red and blue country). See
    http://www.windweaver.com/politics/inthepurple.htm
    Tracy Marks

    ReplyDelete
  19. This purple business is all fine and dandy, and gee the cartograms sure are nifty, but that is not how our electoral system works. Like it or not, it is still winner-take-all. The popular vote can be split almost dead even in a county, but the candidate who receives the most votes wins. Period. Same at the state level.

    Elections are a sport, a game, a competition if you will. Not an activity. If there were nothing at stake, we wouldn't keep score (i.e. counting votes). And as with any competition, the player with the highest score wins.

    So the whole "gee, we're really purple, not red and blue" is irrelevant to who won a particular election. But if it makes you Dems feel better, then so be it. Yes, Virginia, I guess we are a purple nation. 

    Posted by Anon

    ReplyDelete
  20. If I may ask, where did you get your data for the way the counties voted? I'm trying to do a map myself and any help would be most appreciated

    Nate G.
     

    Posted by Nate G.

    ReplyDelete
  21. I downloaded the population and voting data from the USA today tally of votes. The cartograms I already had (from the paper that I cited). let me know if you want the population data: I can send it over to you. 

    Posted by Suresh

    ReplyDelete
  22. Thanks, but I already have the population data, I jsut need the basic 'this county voted for him, this county voted for him' type thing, band I'm having trouble finding it in a workable format (you're right, if I was doing the type of extensive, in depth research you are doing, that USA Today site is perfect. Unfortunately, I jsut need the bare essentials of Republican/Democrat). If you have foudn that in the course of your searching, then let me know. but thank you for your help and concern

    Nate G.  

    Posted by Nate G.

    ReplyDelete
  23. whoa, forgot to mention big part: I'd like it in a table format. That's the biggest problem I'm having is that I can't find it in a .dbf or .xls format. That was my main problem (heck, the data was there, is the fact of having to enter that data for 3,140 US Counties...)

    Thanks,
    Nate G. 

    Posted by Nate G.

    ReplyDelete
  24. whoa, forgot to mention big part: I'd like it in a table format. That's the biggest problem I'm having is that I can't find it in a .dbf or .xls format. That was my main problem (heck, the data was there, is the fact of having to enter that data for 3,140 US Counties...)

    Thanks,
    Nate G. 

    Posted by Nate G.

    ReplyDelete
  25. I see. well even that is easy to arrange. Also, if I give you a CSV file you can import it into excel. the data is not perfect because of various clean up problems in some parts of the northeast (Robert Van der Bei has more discussion on that), but a file is easy enough to generate. let me know who to email it to and I can try and do something later this week (you can email me at sureshv at gmail dot com 

    Posted by Suresh

    ReplyDelete
  26. Sure, just e-mail it to the address da_spoota@hotmail.com. Thank you so much for your cooperation!

    Thanks Again,
    Nate G.  

    Posted by Nate G.

    ReplyDelete
  27. This comment has been removed by a blog administrator.

    ReplyDelete
  28. This comment has been removed by a blog administrator.

    ReplyDelete
  29. This comment has been removed by a blog administrator.

    ReplyDelete
  30. Hello, once again. I was wondering if maybe you had done anything pertaining to my previous questions about the Election results, sorry if I sound forward, its jsut my class is ending soon and after next week, I won't be needing the data anymore.
    Man, that sound forward and almost whiny. Sorry about that.

    Nate G.  

    Posted by Nate G.

    ReplyDelete
  31. if i understand correctly, all you want is a list, for all counties, of who won which one. let me see what I can do. 

    Posted by Suresh

    ReplyDelete
  32. Could someone please direct me to a site or email the 2004 presidential results by county. I'm having a heck of a time finding it online. (Any delimited or other common data format is fine)

    Once received I will post it to my website for others to download. Thanks 

    Posted by Mike J

    ReplyDelete
  33. This comment has been removed by a blog administrator.

    ReplyDelete
  34. This comment has been removed by a blog administrator.

    ReplyDelete
  35. It's amazing. I like this stuff. But did you think about dog fleas

    ReplyDelete
  36. These comments have been invaluable to me as is this whole site. I thank you for your comment.

    ReplyDelete
  37. Finally found really useful information on the topic, thank you.

    If interested, can visit the blog with useful information on Car AA insurance.

    ReplyDelete

Disqus for The Geomblog