Skip to content

Instantly share code, notes, and snippets.

(use '(incanter stats charts)
;; Multi-line plots can be created using Clojure's doto macro
(def x (range 0 20 0.1))
(doto (xy-plot x (cdf-gamma x :shape 1 :rate 2)
:title "Gamma CDF"
:legend true
:y-label "Probability")
view
clear-background
(use '(incanter core charts io))
;; create points to plot
(def x1 (range 0.1 5 0.1))
;; highlight a couple different sets of critical points
(def crit-pts1 [0.5 2 3])
(def crit-pts2 [0.25 2.5 3.5])
;; define a reciprocal function
(defn reciprocal [x] (div 1 x))