Skip to content

Instantly share code, notes, and snippets.

@marvinthepa
Created April 18, 2011 21:00
Show Gist options
  • Save marvinthepa/926168 to your computer and use it in GitHub Desktop.
Save marvinthepa/926168 to your computer and use it in GitHub Desktop.
Number of blades on a safety razor, over time
(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