Created
April 18, 2011 21:00
-
-
Save marvinthepa/926168 to your computer and use it in GitHub Desktop.
Number of blades on a safety razor, over time
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns blades | |
(:use [incanter core stats charts]) | |
(:import java.text.SimpleDateFormat)) | |
(def dates | |
{"first one-bladed gilette safety razor, 1" 1888 | |
"Trac II" 1971 | |
"Mach3" 1998 | |
"Wilkinson Quattro" 2003 | |
"Fusion" 2006 | |
"Albert Heijn" 2011}) ; http://en.wikipedia.org/wiki/Safety_razor | |
(defn parse-year [year] | |
(.getTime | |
(.parse (SimpleDateFormat. "yyyy") (str year)))) | |
(-> (time-series-plot | |
(map parse-year (vals dates)) | |
(range 1 (inc (count dates))) | |
:x-label "t" | |
:y-label "number of blades") | |
view) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment