{"id":1336,"date":"2012-02-15T21:58:18","date_gmt":"2012-02-15T19:58:18","guid":{"rendered":"http:\/\/www.theusrus.de\/blog\/?p=1336"},"modified":"2012-02-16T08:30:53","modified_gmt":"2012-02-16T06:30:53","slug":"the-good-the-bad-22012","status":"publish","type":"post","link":"https:\/\/www.theusrus.de\/blog\/the-good-the-bad-22012\/","title":{"rendered":"The Good &#038; the Bad [2\/2012]"},"content":{"rendered":"<p>Looking for a map of the french Departments, I came across this map of the population density of France on Departments level which can be found on <a href=\"http:\/\/en.wikipedia.org\/wiki\/Departments_of_France\" target=\"_blank\">Wikipedia<\/a> &#8211; and you may guess: this is this month&#8217;s &#8220;The Bad&#8221;.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" title=\"Population Density in France from Wikipedia\" src=\"http:\/\/www.theusRus.de\/Blog-files\/WikiVersion.png\" alt=\"\" width=\"565\" height=\"600\" \/><\/p>\n<p>At first sight there seems to be a contradiction between the apparently continuous color scale (see <a href=\"http:\/\/gabrielflor.it\/\" target=\"_blank\">here<\/a> for some thoughts on coropleth maps) and the map that does not seem to give any decent insight in the geographical distribution of population density. The answer is twofold.<\/p>\n<p>1. The color scale is not continuous but has a break between green and blue (unless you invert the shades of blue) and blue and yellow. What we would expect &#8211; in less saturated colors &#8211; looks like this:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignleft\" title=\"Color Scale\" src=\"http:\/\/www.theusRus.de\/Blog-files\/ColorScale.png\" alt=\"\" width=\"577\" height=\"90\" \/><\/p>\n<p>2. For a map showing a continuous quantity, we usually would not choose so many different saturated colors.<\/p>\n<p>Let&#8217;s approach &#8220;The Good&#8221; as I still need to convince you that there might be a better version of the map. In a perfect world, coropleth maps look smooth and &#8220;continuous&#8221;. For the map of France we might want to look at the distance to the capitol Paris, as France is very centralistic. This map uses a monochromatic scale and shows &#8220;the perfect world&#8221; &#8230;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" title=\"A smooth coropleth map\" src=\"http:\/\/www.theusRus.de\/Blog-files\/DistFromParis.png\" alt=\"\" width=\"533\" height=\"494\" \/><\/p>\n<p>As this one is obviously too trivial, we want to look at the population density as in the above plot (2011 census data from <a href=\"http:\/\/en.wikipedia.org\/wiki\/List_of_French_departments_by_population\" target=\"_blank\">wikipedia<\/a>). Using a simple linear scale we would end up with this (useless) map, which uses a color scale that ranges from blue (small values) over white (median values) to red (large values):<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" title=\"Linear Color Mapping\" src=\"http:\/\/www.theusRus.de\/Blog-files\/FranceLinear.png\" alt=\"\" width=\"533\" height=\"494\" \/><\/p>\n<p>Except for Paris and three other departments, all regions are unpopulated compared to the capitol. The extremely skewed distribution which is shown in the lower left, explains the dilemma.<\/p>\n<p>Using the same &#8220;trick&#8221; as in the original wiki-map, i.e., cutting off all values above 150 we get a map that is easier to read, but now equalizes all information for areas above 150.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" title=\"Large Values Cut Off\" src=\"http:\/\/www.theusRus.de\/Blog-files\/FranceCutOff.png\" alt=\"\" width=\"533\" height=\"494\" \/><\/p>\n<p style=\"text-align: center;\"><span style=\"color: #808080;\">(Note, I used the histogram of log(population Density) for the legend) <\/span><\/p>\n<p style=\"text-align: left;\"><span style=\"color: #000000;\">The result is much better now, but there seem to be too many departments put into a single class.<\/span><\/p>\n<p>From the data on the log-scale, we already see what would be most desirable, i.e., a distribution of colors, which is close to a normal distribution. Using a non-continuous transformation of the variable we display, we can map the color-shades to be normal, which ends up in the following map, which I would classify as &#8220;The Good&#8221;.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" title=\"A better map for the population density in France\" src=\"http:\/\/www.theusRus.de\/Blog-files\/FranceTheGood.png\" alt=\"\" width=\"533\" height=\"494\" \/><\/p>\n<p>We now get a fairly good feeling of which regions are highly populated, which ones are close to the median (even with a distinction of being above or below average) and also clearly see the extremely unpopulated departments.<\/p>\n<p>There is a lot more to say about the do&#8217;s and don&#8217;ts for drawing choropleth maps (which can be found <a href=\"http:\/\/www.interactivegraphics.org\" target=\"_blank\">here<\/a> in Chapter 6). What is even more fun is to play around yourself! Here is the <a href=\"http:\/\/www.theusRus.de\/Blog-files\/France.zip\" target=\"_blank\">data<\/a> (unzip and load France.txt with Mondrian) and here is the <a href=\"http:\/\/www.theusRus.de\/Mondrian\" target=\"_blank\">software<\/a> &#8211; have fun!<\/p>\n<p>(Thanks to <a href=\"http:\/\/www.rosuda.org\/~unwin\" target=\"_blank\">Antony<\/a> for providing the map!)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Looking for a map of the french Departments, I came across this map of the population density of France on Departments level which can be found on Wikipedia &#8211; and you may guess: this is this month&#8217;s &#8220;The Bad&#8221;. At first sight there seems to be a contradiction between the apparently continuous color scale (see [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,5],"tags":[],"class_list":["post-1336","post","type-post","status-publish","format-standard","hentry","category-general","category-the-good-the-bad"],"_links":{"self":[{"href":"https:\/\/www.theusrus.de\/blog\/wp-json\/wp\/v2\/posts\/1336","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.theusrus.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.theusrus.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.theusrus.de\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.theusrus.de\/blog\/wp-json\/wp\/v2\/comments?post=1336"}],"version-history":[{"count":17,"href":"https:\/\/www.theusrus.de\/blog\/wp-json\/wp\/v2\/posts\/1336\/revisions"}],"predecessor-version":[{"id":1350,"href":"https:\/\/www.theusrus.de\/blog\/wp-json\/wp\/v2\/posts\/1336\/revisions\/1350"}],"wp:attachment":[{"href":"https:\/\/www.theusrus.de\/blog\/wp-json\/wp\/v2\/media?parent=1336"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.theusrus.de\/blog\/wp-json\/wp\/v2\/categories?post=1336"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.theusrus.de\/blog\/wp-json\/wp\/v2\/tags?post=1336"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}