Skip to content

Instantly share code, notes, and snippets.

@liebke
Created May 29, 2009 00:18
Show Gist options
  • Save liebke/119687 to your computer and use it in GitHub Desktop.
Save liebke/119687 to your computer and use it in GitHub Desktop.
(use '(incanter core stats charts))
;; Overlay a xy-plot on a histogram
;; Plot a histogram of a normal sample of size 1000, using the :density option
;; so that the y-axis represents density instead of the default frequency.
;; Then plot a pdf curve for the normal distribution on the same chart.
(def x (range -3 3 0.01))
(doto (histogram (sample-normal 1000) :density true)
(add-lines x (pdf-normal x))
view)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment