{"id":1014,"date":"2010-01-19T08:16:06","date_gmt":"2010-01-19T16:16:06","guid":{"rendered":"http:\/\/dougmccune.com\/blog\/?p=1014"},"modified":"2013-06-09T13:25:10","modified_gmt":"2013-06-09T21:25:10","slug":"recreating-william-playfairs-importexport-charts","status":"publish","type":"post","link":"https:\/\/dougmccune.com\/blog\/2010\/01\/19\/recreating-william-playfairs-importexport-charts\/","title":{"rendered":"Recreating William Playfair&#8217;s Import\/Export Charts"},"content":{"rendered":"<p>I&#8217;ve been reading William Playfair&#8217;s Commercial and Political Atlas, in which he invented the line chart. In the book, Playfair examines the imports and exports between Britain and various countries. To illustrate these trade relationships, Playfair created the first ever line charts that show the change in trade over time. <\/p>\n<h1>The Inspiration<\/h1>\n<p>Each section of the book covered a different country, and each one contained a chart that showed the imports and exports like this:<\/p>\n<p><a title=\"playfair_north_america_trade2\" href=\"https:\/\/i0.wp.com\/dougmccune.com\/blog\/wp-content\/uploads\/2010\/01\/playfair_north_america_trade2.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"attachment wp-att-900 \" src=\"https:\/\/i0.wp.com\/dougmccune.com\/blog\/wp-content\/uploads\/2010\/01\/playfair_north_america_trade2.thumbnail.jpg?resize=400%2C223&#038;ssl=1\" alt=\"playfair_north_america_trade2\" width=\"400\" height=\"223\" align=\"none\" \/><\/a><br \/>\n<a href=\"https:\/\/i0.wp.com\/dougmccune.com\/blog\/wp-content\/uploads\/2010\/01\/playfair_ireland.jpg?ssl=1\" title=\"playfair_ireland\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/dougmccune.com\/blog\/wp-content\/uploads\/2010\/01\/playfair_ireland.thumbnail.jpg?resize=400%2C239&#038;ssl=1\" alt=\"playfair_ireland\" align=\"none\" width=\"400\" height=\"239\" class=\"attachment wp-att-1015 \" \/><\/a><br \/>\nTwo line series are shown, one for imports and one for exports, and shading is used to show when there was a &#8220;balance in favor of England&#8221; (when there were more exports than imports). <\/p>\n<h1>My Recreation<\/h1>\n<p>I&#8217;ve been captivated by these charts and wanted to recreate them, but with modern data. You can find <a href=\"http:\/\/www.census.gov\/foreign-trade\/balance\/index.html\">tons of US trade data<\/a> at the US Census Bureau&#8217;s website, including a <a href=\"http:\/\/www.census.gov\/foreign-trade\/balance\/country.zip\">spreadsheet<\/a> that has all the data in one place. I downloaded that data and put together a little application to create Playfair-esque charts.<\/p>\n<p>Click this screenshot to <a href=\"http:\/\/dougmccune.com\/flex\/recreatingPlayfair\/\">play with the app yourself<\/a>:<br \/>\n<a href=\"http:\/\/dougmccune.com\/flex\/recreatingPlayfair\/\" title=\"playfair_app_screenshot\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/dougmccune.com\/blog\/wp-content\/uploads\/2010\/01\/playfair_app_screenshot.png?resize=400%2C245&#038;ssl=1\" alt=\"playfair_app_screenshot\" align=\"none\" width=\"400\" height=\"245\" class=\"attachment wp-att-1017 \" \/><\/a><br \/>\n<a href=\"http:\/\/dougmccune.com\/flex\/recreatingPlayfair\/srcview\/index.html\">View source<\/a> is enabled.<\/p>\n<p>The app displays all the countries that the US has trade data for, month by month going back as far as 1985. Each country is displayed in the list on the left with a sparkline chart of the trade data. A red fill indicates we are importing from a given country more than we are exporting, and a light green fill indicates we are exporting more than we are importing.<\/p>\n<h1>Exploring the data<\/h1>\n<p>The charts tell some really interesting stories. Some of the charts show a nearly identical relationship of imports to exports, both growing at the same rates, like these charts of the UK and Guatemala.<br \/>\n<a href=\"https:\/\/i0.wp.com\/dougmccune.com\/blog\/wp-content\/uploads\/2010\/01\/united_kingdom.png?ssl=1\" title=\"united_kingdom\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/dougmccune.com\/blog\/wp-content\/uploads\/2010\/01\/united_kingdom.thumbnail.png?resize=400%2C306&#038;ssl=1\" alt=\"united_kingdom\" align=\"none\" width=\"400\" height=\"306\" class=\"attachment wp-att-1036 \" \/><\/a><br \/>\n<a href=\"https:\/\/i0.wp.com\/dougmccune.com\/blog\/wp-content\/uploads\/2010\/01\/guatemala.png?ssl=1\" title=\"guatemala\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/dougmccune.com\/blog\/wp-content\/uploads\/2010\/01\/guatemala.thumbnail.png?resize=400%2C305&#038;ssl=1\" alt=\"guatemala\" align=\"none\" width=\"400\" height=\"305\" class=\"attachment wp-att-1037 \" \/><\/a><\/p>\n<p>While some other charts show different relationships. Notice how exports to Hong Kong have been steadily increasing, but imports from Hong Kong have been declining.<br \/>\n<a href=\"https:\/\/i0.wp.com\/dougmccune.com\/blog\/wp-content\/uploads\/2010\/01\/hong_kong.png?ssl=1\" title=\"hong_kong\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/dougmccune.com\/blog\/wp-content\/uploads\/2010\/01\/hong_kong.thumbnail.png?resize=400%2C305&#038;ssl=1\" alt=\"hong_kong\" align=\"none\" width=\"400\" height=\"305\" class=\"attachment wp-att-1024 \" \/><\/a><\/p>\n<p>Or we can see what imposing sanctions on a country looks like, as illustrated by <a href=\"http:\/\/www.treas.gov\/offices\/enforcement\/ofac\/programs\/burma\/burma.shtml\">sanctions on Burma<\/a> that were put into place in 2003:<br \/>\n<a href=\"https:\/\/i0.wp.com\/dougmccune.com\/blog\/wp-content\/uploads\/2010\/01\/burma.png?ssl=1\" title=\"burma\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/dougmccune.com\/blog\/wp-content\/uploads\/2010\/01\/burma.thumbnail.png?resize=400%2C304&#038;ssl=1\" alt=\"burma\" align=\"none\" width=\"400\" height=\"304\" class=\"attachment wp-att-1025 \" \/><\/a><\/p>\n<p>Or what a <a href=\"http:\/\/en.wikipedia.org\/wiki\/Haiti#1990s\">coup in Haiti<\/a> looks like:<br \/>\n<a href=\"https:\/\/i0.wp.com\/dougmccune.com\/blog\/wp-content\/uploads\/2010\/01\/haiti.png?ssl=1\" title=\"haiti\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/dougmccune.com\/blog\/wp-content\/uploads\/2010\/01\/haiti.thumbnail.png?resize=400%2C306&#038;ssl=1\" alt=\"haiti\" align=\"none\" width=\"400\" height=\"306\" class=\"attachment wp-att-1026 \" \/><\/a><\/p>\n<p>Or what a <a href=\"http:\/\/en.wikipedia.org\/wiki\/Effect_of_the_2004_Indian_Ocean_earthquake_on_the_Maldives\">massive tsunami<\/a> can do to a place like the Maldives:<br \/>\n<a href=\"https:\/\/i0.wp.com\/dougmccune.com\/blog\/wp-content\/uploads\/2010\/01\/maldives.png?ssl=1\" title=\"maldives\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/dougmccune.com\/blog\/wp-content\/uploads\/2010\/01\/maldives.thumbnail.png?resize=400%2C305&#038;ssl=1\" alt=\"maldives\" align=\"none\" width=\"400\" height=\"305\" class=\"attachment wp-att-1027 \" \/><\/a><\/p>\n<p>We can see the massive growth of China (and notice how interestingly seasonal each year is, peaking in October):<br \/>\n<a href=\"https:\/\/i0.wp.com\/dougmccune.com\/blog\/wp-content\/uploads\/2010\/01\/china.png?ssl=1\" title=\"china\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/dougmccune.com\/blog\/wp-content\/uploads\/2010\/01\/china.thumbnail.png?resize=400%2C305&#038;ssl=1\" alt=\"china\" align=\"none\" width=\"400\" height=\"305\" class=\"attachment wp-att-1028 \" \/><\/a><\/p>\n<p>And one final one that I find very interesting, isn&#8217;t a country, but the import and export of what is classified as &#8220;<a href=\"http:\/\/www.census.gov\/foreign-trade\/reference\/glossary\/a\/atp.html\">Advanced Technology Products<\/a>&#8220;, which includes things like biotech and advanced electronics products. Notice how up until the early 2000s we were exporting more of these products than we were importing, but by 2002 that balance shifted and the gap continues to increase:<br \/>\n<a href=\"https:\/\/i0.wp.com\/dougmccune.com\/blog\/wp-content\/uploads\/2010\/01\/advance_tech_products.png?ssl=1\" title=\"advance_tech_products\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/dougmccune.com\/blog\/wp-content\/uploads\/2010\/01\/advance_tech_products.thumbnail.png?resize=400%2C304&#038;ssl=1\" alt=\"advance_tech_products\" align=\"none\" width=\"400\" height=\"304\" class=\"attachment wp-att-1029 \" \/><\/a><\/p>\n<p>I had fun creating this app, but one thing I didn&#8217;t expect was how much fun researching the charts was going to be. The charts that stuck out with trends that were abnormal all had interesting stories to tell about the history of the country.<\/p>\n<p>In closing, I&#8217;ll end with a quote from Playfair in which he describes the concept of displaying numeric values in a line chart (remember, he was the first person to actually do this):<\/p>\n<blockquote><p>As the eye is the best judge of proportion, being able to estimate it with more quickness and accuracy than any other of our organs, it follows, that wherever relative quantities are in question &#8230; this mode of representing it is peculiarly applicable; it gives a simple, accurate, and permanent idea, by giving form and shape to a number of separate ideas, which are otherwise abstract and unconnected.<\/p><\/blockquote>\n<p>Well said, Mr. Playfair, well said. Your charts are just as effective nearly 200 years later.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been reading William Playfair&#8217;s Commercial and Political Atlas, in which he invented the line chart. In the book, Playfair examines the imports and exports between Britain and various countries. To illustrate these trade relationships, Playfair created the first ever line charts that show the change in trade over time. The Inspiration Each section of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[66],"tags":[67,68],"class_list":["post-1014","post","type-post","status-publish","format-standard","hentry","category-data-visualization","tag-history","tag-william-playfair"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/dougmccune.com\/blog\/wp-json\/wp\/v2\/posts\/1014","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dougmccune.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dougmccune.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dougmccune.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dougmccune.com\/blog\/wp-json\/wp\/v2\/comments?post=1014"}],"version-history":[{"count":22,"href":"https:\/\/dougmccune.com\/blog\/wp-json\/wp\/v2\/posts\/1014\/revisions"}],"predecessor-version":[{"id":1741,"href":"https:\/\/dougmccune.com\/blog\/wp-json\/wp\/v2\/posts\/1014\/revisions\/1741"}],"wp:attachment":[{"href":"https:\/\/dougmccune.com\/blog\/wp-json\/wp\/v2\/media?parent=1014"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dougmccune.com\/blog\/wp-json\/wp\/v2\/categories?post=1014"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dougmccune.com\/blog\/wp-json\/wp\/v2\/tags?post=1014"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}