

{"id":1191,"date":"2012-06-07T12:17:29","date_gmt":"2012-06-07T17:17:29","guid":{"rendered":"http:\/\/rud.is\/b\/?p=1191"},"modified":"2017-03-27T09:40:31","modified_gmt":"2017-03-27T14:40:31","slug":"slopegraphs-in-python-exploring-binningrounding","status":"publish","type":"post","link":"https:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-exploring-binningrounding\/","title":{"rendered":"Slopegraphs in Python \u2013 Exploring Binning\/Rounding"},"content":{"rendered":"<p>One of the last items for the 1.0 release is support for multiple columns of data. That will require some additional refactoring, so I&#8217;ve been procrastinating by <a href=\"https:\/\/rud.is\/b\/2012\/06\/05\/slopegraphs-the-quintessential-gdp-example-revisited\/\">exploring the recent &#8220;fudging&#8221; discovery<\/a>. Despite claims to the contrary on other sites, there <em>are<\/em> more folks playing with slopegraphs than you might imagine. The inspiration for today&#8217;s installment comes from Jon Custer (@stuffisthings). He has a <span class=\"removed_link\" title=\"http:\/\/amoondisaster.wordpress.com\/2011\/07\/15\/telling-stories-with-data-the-slopegraph\/\">two<\/span> <span class=\"removed_link\" title=\"http:\/\/amoondisaster.wordpress.com\/2011\/07\/18\/telling-stories-with-data-ii-the-slopegraph-strikes-back\/\">part<\/span> &#8220;<em>Telling Stories with Data<\/em>&#8221; series that does some exploration of export data with slopegraphs. In his &#8220;<em>Slopegraph Strikes Back<\/em>&#8221; post, Jon does a spiffy job discussing data visualization fundamentals and walks the reader through his re-design of a chart on commodities ranking, including a commentary on an aspect of slopegraphs that I&#8217;ve been noticing as I&#8217;ve been doing my exploring: the &#8216;scale&#8217; problem (which I began to point out in the aforementioned &#8220;fudging&#8221; post).<\/p>\n<p>The data set Jon is working with allows for a great exploration as to what works best when trying to convey a message with slopegraphs. I took the values from one of the tables he extracted:<\/p>\n<p><center><a href=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2012\/06\/tanz_top_ten.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1192\" data-permalink=\"https:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-exploring-binningrounding\/tanz_top_ten\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2012\/06\/tanz_top_ten.png?fit=954%2C509&amp;ssl=1\" data-orig-size=\"954,509\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"tanz_top_ten\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2012\/06\/tanz_top_ten.png?fit=300%2C160&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2012\/06\/tanz_top_ten.png?fit=510%2C272&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2012\/06\/tanz_top_ten.png?resize=300%2C160&#038;ssl=1\" alt=\"\" title=\"tanz_top_ten\" width=\"300\" height=\"160\" class=\"aligncenter size-medium wp-image-1192\" srcset=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2012\/06\/tanz_top_ten.png?resize=300%2C160&amp;ssl=1 300w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2012\/06\/tanz_top_ten.png?w=954&amp;ssl=1 954w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/center><\/p>\n<p>and made a &#8220;raw&#8221; slopegraph from them (focusing on the &#8220;top 10&#8221;). The graphic won&#8217;t even come close to fitting in this post but <a href=\"https:\/\/rud.is\/b\/wp-content\/uploads\/2012\/06\/tanzania-dollars.pdf\">you can grab the PDF<\/a> of it and see how scale is the primary enemy of slopegraphs. It <em>does<\/em> show how gold and precious metal ores have skyrocketed from 1998 to 2007, but it&#8217;s hardly an engaging and easy to read visualization (unless you <i>really<\/i> like using your scroll wheel).<\/p>\n<p>Jon grok&#8217;d this point, too, and decided to focus on the <a href=\"http:\/\/www.hpl.hp.com\/research\/idl\/papers\/ranking\/ranking.html\">power law ranking<\/a> and use the slopegraph to present the rate of change of each commodity:<\/p>\n<p><center><a href=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2012\/06\/tanzania-slopegraph-smaller.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1194\" data-permalink=\"https:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-exploring-binningrounding\/tanzania-slopegraph-smaller\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2012\/06\/tanzania-slopegraph-smaller.png?fit=580%2C705&amp;ssl=1\" data-orig-size=\"580,705\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"tanzania-slopegraph-smaller\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2012\/06\/tanzania-slopegraph-smaller.png?fit=246%2C300&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2012\/06\/tanzania-slopegraph-smaller.png?fit=510%2C620&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2012\/06\/tanzania-slopegraph-smaller.png?resize=510%2C620&#038;ssl=1\" alt=\"\" title=\"tanzania-slopegraph-smaller\" width=\"510\" height=\"620\" class=\"aligncenter size-full wp-image-1194\" srcset=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2012\/06\/tanzania-slopegraph-smaller.png?w=580&amp;ssl=1 580w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2012\/06\/tanzania-slopegraph-smaller.png?resize=246%2C300&amp;ssl=1 246w\" sizes=\"auto, (max-width: 510px) 100vw, 510px\" \/><\/a><\/center><\/p>\n<p>While he didn&#8217;t &#8220;pull a Tufte&#8221; and just include values without caveat (see left &#038; right 90&deg; side labels), I still believe that there needs to be either increased annotation or the inclusion of base tabular data. Using my PySlopegraph code (forgot to mention the name change), I worked up a version of Jon&#8217;s visualization that I believe provides a clean, honest view of the data (<i>click for larger view<\/i>):<\/p>\n<p><center><a target=\"_slopegraph\" href=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2012\/06\/tanzania-percent.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1196\" data-permalink=\"https:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-exploring-binningrounding\/tanzania-percent\/\" data-orig-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2012\/06\/tanzania-percent.png?fit=1583%2C736&amp;ssl=1\" data-orig-size=\"1583,736\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"tanzania-percent\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2012\/06\/tanzania-percent.png?fit=300%2C139&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2012\/06\/tanzania-percent.png?fit=510%2C237&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2012\/06\/tanzania-percent.png?resize=300%2C139&#038;ssl=1\" alt=\"\" title=\"tanzania-percent\" width=\"300\" height=\"139\" class=\"aligncenter size-medium wp-image-1196\" srcset=\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2012\/06\/tanzania-percent.png?resize=300%2C139&amp;ssl=1 300w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2012\/06\/tanzania-percent.png?resize=1024%2C476&amp;ssl=1 1024w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2012\/06\/tanzania-percent.png?w=1583&amp;ssl=1 1583w, https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2012\/06\/tanzania-percent.png?w=1530&amp;ssl=1 1530w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/center><\/p>\n<p>Because the chart is still based on the percentages that are fairly precise:<\/p>\n<pre lang=\"csv\" line=\"1\">\"Coconuts, Brazil nuts, cashews\",17.93,0.93\r\nCoffee,12.93,3.91\r\nFish,7.89,5.04\r\nTobacco,7.25,3.19\r\nGold,6.62,18.63\r\nTea,4.14,1.32\r\nCotton,4.01,1.36\r\nCloves,3.58,0.29\r\nDiamonds,3.44,0.58\r\nMounted stones,2.44,1.5\r\nVegetables,1.61,1.73\r\nWheat,0.54,1.38\r\n\"Precious metal ores\",0,6.76<\/pre>\n<p>I finally added an option to the PySlopegraph configuration file for rounding (NOTE: <b>rounding != true binning<\/b>). If you add the &#8220;<code>round_precision<\/code>&#8221; option with a value that supports Python&#8217;s <code>round<\/code> function&#8217;s <a href=\"https:\/\/docs.python.org\/3\/library\/functions.html#round\">little-known second parameter<\/a> (arbitrary positional rounding), you can have the values round to decimal or tens\/hundreds\/etc places which will help with scaling issues, but will also group items (in ways that you may not have originally intended). For this chart, if we use a value of &#8220;1&#8221; (first decimal rounding precision\u2026use negative values for rounding on the whole integer side of the decimal) it&#8217;s <em>still<\/em> unreadable due to the scale it imposes by that precision, so I ended up using the nearest whole integer rounding option (value of &#8220;0&#8221;) and also included the table of actual values, along with annotating the &#8220;rate of change&#8221; nature of the slopes. <\/p>\n<p>This (again) defeats the &#8220;no wasted ink (<em>pixels?<\/em>)&#8221; component of Tufte&#8217;s original creation, but I believe it&#8217;s necessary for some types of slopegraphs to ensure the chart can stand on it&#8217;s own. I&#8217;m definitely becoming more convinced that many slopegraphs are more suited for an interactive visualization where you can encode more information in rollovers\/popups\/etc plus allow for switching of view from percentage, power-law ranking or raw numeric comparison.<\/p>\n<p>For those interested in playing with this particular data set, it&#8217;ll be included in the next <a href=\"https:\/\/github.com\/hrbrmstr\/slopegraph\">github<\/a> code push, which will also include the rounding feature.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the last items for the 1.0 release is support for multiple columns of data. That will require some additional refactoring, so I&#8217;ve been procrastinating by exploring the recent &#8220;fudging&#8221; discovery. Despite claims to the contrary on other sites, there are more folks playing with slopegraphs than you might imagine. The inspiration for today&#8217;s [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[24,63,7,640],"tags":[751,657,658],"class_list":["post-1191","post","type-post","status-publish","format-standard","hentry","category-charts-graphs","category-development","category-programming","category-python-2","tag-slopegraph","tag-table-chart","tag-tufte"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Slopegraphs in Python \u2013 Exploring Binning\/Rounding - rud.is<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-exploring-binningrounding\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Slopegraphs in Python \u2013 Exploring Binning\/Rounding - rud.is\" \/>\n<meta property=\"og:description\" content=\"One of the last items for the 1.0 release is support for multiple columns of data. That will require some additional refactoring, so I&#8217;ve been procrastinating by exploring the recent &#8220;fudging&#8221; discovery. Despite claims to the contrary on other sites, there are more folks playing with slopegraphs than you might imagine. The inspiration for today&#8217;s [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-exploring-binningrounding\/\" \/>\n<meta property=\"og:site_name\" content=\"rud.is\" \/>\n<meta property=\"article:published_time\" content=\"2012-06-07T17:17:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-03-27T14:40:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/rud.is\/b\/wp-content\/uploads\/2012\/06\/tanz_top_ten-300x160.png\" \/>\n<meta name=\"author\" content=\"hrbrmstr\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"hrbrmstr\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-exploring-binningrounding\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-exploring-binningrounding\/\"},\"author\":{\"name\":\"hrbrmstr\",\"@id\":\"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886\"},\"headline\":\"Slopegraphs in Python \u2013 Exploring Binning\/Rounding\",\"datePublished\":\"2012-06-07T17:17:29+00:00\",\"dateModified\":\"2017-03-27T14:40:31+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-exploring-binningrounding\/\"},\"wordCount\":612,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886\"},\"image\":{\"@id\":\"https:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-exploring-binningrounding\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/rud.is\/b\/wp-content\/uploads\/2012\/06\/tanz_top_ten-300x160.png\",\"keywords\":[\"slopegraph\",\"table-chart\",\"tufte\"],\"articleSection\":[\"Charts &amp; Graphs\",\"Development\",\"Programming\",\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-exploring-binningrounding\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-exploring-binningrounding\/\",\"url\":\"https:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-exploring-binningrounding\/\",\"name\":\"Slopegraphs in Python \u2013 Exploring Binning\/Rounding - rud.is\",\"isPartOf\":{\"@id\":\"https:\/\/rud.is\/b\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-exploring-binningrounding\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-exploring-binningrounding\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/rud.is\/b\/wp-content\/uploads\/2012\/06\/tanz_top_ten-300x160.png\",\"datePublished\":\"2012-06-07T17:17:29+00:00\",\"dateModified\":\"2017-03-27T14:40:31+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-exploring-binningrounding\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-exploring-binningrounding\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-exploring-binningrounding\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2012\/06\/tanz_top_ten.png?fit=954%2C509&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2012\/06\/tanz_top_ten.png?fit=954%2C509&ssl=1\",\"width\":\"954\",\"height\":\"509\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-exploring-binningrounding\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/rud.is\/b\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Slopegraphs in Python \u2013 Exploring Binning\/Rounding\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/rud.is\/b\/#website\",\"url\":\"https:\/\/rud.is\/b\/\",\"name\":\"rud.is\",\"description\":\"&quot;In God we trust. All others must bring data&quot;\",\"publisher\":{\"@id\":\"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/rud.is\/b\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886\",\"name\":\"hrbrmstr\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1\",\"url\":\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1\",\"width\":460,\"height\":460,\"caption\":\"hrbrmstr\"},\"logo\":{\"@id\":\"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1\"},\"description\":\"Don't look at me\u2026I do what he does \u2014 just slower. #rstats avuncular \u2022 ?Resistance Fighter \u2022 Cook \u2022 Christian \u2022 [Master] Chef des Donn\u00e9es de S\u00e9curit\u00e9 @ @rapid7\",\"sameAs\":[\"http:\/\/rud.is\"],\"url\":\"https:\/\/rud.is\/b\/author\/hrbrmstr\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Slopegraphs in Python \u2013 Exploring Binning\/Rounding - rud.is","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-exploring-binningrounding\/","og_locale":"en_US","og_type":"article","og_title":"Slopegraphs in Python \u2013 Exploring Binning\/Rounding - rud.is","og_description":"One of the last items for the 1.0 release is support for multiple columns of data. That will require some additional refactoring, so I&#8217;ve been procrastinating by exploring the recent &#8220;fudging&#8221; discovery. Despite claims to the contrary on other sites, there are more folks playing with slopegraphs than you might imagine. The inspiration for today&#8217;s [&hellip;]","og_url":"https:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-exploring-binningrounding\/","og_site_name":"rud.is","article_published_time":"2012-06-07T17:17:29+00:00","article_modified_time":"2017-03-27T14:40:31+00:00","og_image":[{"url":"https:\/\/rud.is\/b\/wp-content\/uploads\/2012\/06\/tanz_top_ten-300x160.png","type":"","width":"","height":""}],"author":"hrbrmstr","twitter_card":"summary_large_image","twitter_misc":{"Written by":"hrbrmstr","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-exploring-binningrounding\/#article","isPartOf":{"@id":"https:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-exploring-binningrounding\/"},"author":{"name":"hrbrmstr","@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"headline":"Slopegraphs in Python \u2013 Exploring Binning\/Rounding","datePublished":"2012-06-07T17:17:29+00:00","dateModified":"2017-03-27T14:40:31+00:00","mainEntityOfPage":{"@id":"https:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-exploring-binningrounding\/"},"wordCount":612,"commentCount":1,"publisher":{"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"image":{"@id":"https:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-exploring-binningrounding\/#primaryimage"},"thumbnailUrl":"https:\/\/rud.is\/b\/wp-content\/uploads\/2012\/06\/tanz_top_ten-300x160.png","keywords":["slopegraph","table-chart","tufte"],"articleSection":["Charts &amp; Graphs","Development","Programming","Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-exploring-binningrounding\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-exploring-binningrounding\/","url":"https:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-exploring-binningrounding\/","name":"Slopegraphs in Python \u2013 Exploring Binning\/Rounding - rud.is","isPartOf":{"@id":"https:\/\/rud.is\/b\/#website"},"primaryImageOfPage":{"@id":"https:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-exploring-binningrounding\/#primaryimage"},"image":{"@id":"https:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-exploring-binningrounding\/#primaryimage"},"thumbnailUrl":"https:\/\/rud.is\/b\/wp-content\/uploads\/2012\/06\/tanz_top_ten-300x160.png","datePublished":"2012-06-07T17:17:29+00:00","dateModified":"2017-03-27T14:40:31+00:00","breadcrumb":{"@id":"https:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-exploring-binningrounding\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-exploring-binningrounding\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-exploring-binningrounding\/#primaryimage","url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2012\/06\/tanz_top_ten.png?fit=954%2C509&ssl=1","contentUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2012\/06\/tanz_top_ten.png?fit=954%2C509&ssl=1","width":"954","height":"509"},{"@type":"BreadcrumbList","@id":"https:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-exploring-binningrounding\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/rud.is\/b\/"},{"@type":"ListItem","position":2,"name":"Slopegraphs in Python \u2013 Exploring Binning\/Rounding"}]},{"@type":"WebSite","@id":"https:\/\/rud.is\/b\/#website","url":"https:\/\/rud.is\/b\/","name":"rud.is","description":"&quot;In God we trust. All others must bring data&quot;","publisher":{"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/rud.is\/b\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/rud.is\/b\/#\/schema\/person\/d7cb7487ab0527447f7fda5c423ff886","name":"hrbrmstr","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1","url":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1","contentUrl":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1","width":460,"height":460,"caption":"hrbrmstr"},"logo":{"@id":"https:\/\/i0.wp.com\/rud.is\/b\/wp-content\/uploads\/2023\/10\/ukr-shield.png?fit=460%2C460&ssl=1"},"description":"Don't look at me\u2026I do what he does \u2014 just slower. #rstats avuncular \u2022 ?Resistance Fighter \u2022 Cook \u2022 Christian \u2022 [Master] Chef des Donn\u00e9es de S\u00e9curit\u00e9 @ @rapid7","sameAs":["http:\/\/rud.is"],"url":"https:\/\/rud.is\/b\/author\/hrbrmstr\/"}]}},"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p23idr-jd","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":1181,"url":"https:\/\/rud.is\/b\/2012\/06\/05\/slopegraphs-in-python-slope-colors\/","url_meta":{"origin":1191,"position":0},"title":"Slopegraphs in Python \u2013 Slope Colors","author":"hrbrmstr","date":"2012-06-05","format":false,"excerpt":"As the codebase gets closer to the 1.0 stretch we now have the addition of slope colors for when values go up\/down or remain constant between points. The code still only handles two columns of data, but the intent is for each segment to also be colored appropriately (up\/down\/same) in\u2026","rel":"","context":"In &quot;Charts &amp; Graphs&quot;","block_context":{"text":"Charts &amp; Graphs","link":"https:\/\/rud.is\/b\/category\/charts-graphs\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1334,"url":"https:\/\/rud.is\/b\/2012\/06\/20\/slopegraphs-in-python-failed-states-index-part-1\/","url_meta":{"origin":1191,"position":1},"title":"Slopegraphs in Python \u2013\u00a0Failed States Index (Part 1)","author":"hrbrmstr","date":"2012-06-20","format":false,"excerpt":"The Fund For Peace (FFP) and Foreign Policy jointly released the 2012 version of the \"failed states index\" (FSI). From the FFP site, the FSI: \u2026focuses on the indicators of risk and is based on thousands of articles and reports that are processed by our CAST Software from electronically available\u2026","rel":"","context":"In &quot;Charts &amp; Graphs&quot;","block_context":{"text":"Charts &amp; Graphs","link":"https:\/\/rud.is\/b\/category\/charts-graphs\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2448,"url":"https:\/\/rud.is\/b\/2013\/04\/13\/pc-maker-slopegraph-more-functional-table-one-last-time\/","url_meta":{"origin":1191,"position":2},"title":"PC Maker Slopegraph + More Functional Table (One Last Time)","author":"hrbrmstr","date":"2013-04-13","format":false,"excerpt":"Now that I'm back in the US and relaxing, I can take time for one final blather on the [PC Maker Slopegraph](http:\/\/rud.is\/b\/2013\/04\/11\/ugly-tables-vs-slopegraphs-pc-maker-shipments-marketshare\/) post from earlier in the week. Slopegraphs can be quite long depending on the increment between discrete entries (as I've [pointed out before](http:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-exploring-binningrounding\/)). You either need to do\u2026","rel":"","context":"In &quot;Charts &amp; Graphs&quot;","block_context":{"text":"Charts &amp; Graphs","link":"https:\/\/rud.is\/b\/category\/charts-graphs\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1115,"url":"https:\/\/rud.is\/b\/2012\/05\/29\/slopegraphs-in-python-colors-fonts-alignment\/","url_meta":{"origin":1191,"position":3},"title":"Slopegraphs In Python \u2013\u00a0colors, fonts &#038; alignment","author":"hrbrmstr","date":"2012-05-29","format":false,"excerpt":"On the heels of last evening's release of Slopegraphs in Python post comes some minor tweaks: Complete alignment control of labels & and values Colors (for background, lines, labels & values) \u2014 I picked a random pattern from Adobe's Kuler A font change (to prove width calculations work) \u2026and a\u2026","rel":"","context":"In &quot;Charts &amp; Graphs&quot;","block_context":{"text":"Charts &amp; Graphs","link":"https:\/\/rud.is\/b\/category\/charts-graphs\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1213,"url":"https:\/\/rud.is\/b\/2012\/06\/07\/slopegraphs-in-python-log-scales-spam-data-analysis\/","url_meta":{"origin":1191,"position":4},"title":"Slopegraphs in Python \u2013 Log Scales &#038; Spam Data Analysis","author":"hrbrmstr","date":"2012-06-07","format":false,"excerpt":"Given the focus on actual development of the PySlopegraph tool in most of the blog posts of late, folks may be wondering why an infosec\/inforisk guy is obsessing so much on a tool and not talking security. Besides the fixation on filling a void and promoting an underused visualization tool,\u2026","rel":"","context":"In &quot;Charts &amp; Graphs&quot;","block_context":{"text":"Charts &amp; Graphs","link":"https:\/\/rud.is\/b\/category\/charts-graphs\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1089,"url":"https:\/\/rud.is\/b\/2012\/05\/28\/slopegraphs-in-python\/","url_meta":{"origin":1191,"position":5},"title":"Slopegraphs in Python","author":"hrbrmstr","date":"2012-05-28","format":false,"excerpt":"(NOTE: You can keep up with progress best at github, but can always search on \"slopegraph\" here or just hit the tag page: \"slopegraph\" regularly) I've been a bit obsessed with slopegraphs (a.k.a \"Tufte table-chart\") of late and very dissatisfied with the lack of tools to make this particular visualization\u2026","rel":"","context":"In &quot;Charts &amp; Graphs&quot;","block_context":{"text":"Charts &amp; Graphs","link":"https:\/\/rud.is\/b\/category\/charts-graphs\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/1191","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/comments?post=1191"}],"version-history":[{"count":0,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/posts\/1191\/revisions"}],"wp:attachment":[{"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/media?parent=1191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/categories?post=1191"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rud.is\/b\/wp-json\/wp\/v2\/tags?post=1191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}