1.2.3-SNAPSHOT permalink Arrow_down_16x16

set-background-default

incanter.charts



Examples:
(use '(incanter core stats charts datasets))

(doto (histogram (sample-normal 1000) :title (str :Test-Tittle))
set-theme-bw
view)


(doto (histogram (sample-normal 1000))
set-background-default
(add-histogram (sample-normal 1000 :mean 1))
view)


(doto (scatter-plot :speed :dist :data (get-dataset :cars))
set-theme-bw
view)

(doto (scatter-plot :speed :dist :data (get-dataset :cars))
set-theme-bw
(set-stroke :dash 5)
(add-points (plus ($ :speed (get-dataset :cars)) 5) (plus ($ :dist (get-dataset :cars)) 10))
view)

(doto (scatter-plot :speed :dist :data (get-dataset :cars))
set-background-default
(set-stroke :dash 5)
(add-function sin 0 25)
view)


(doto (xy-plot :speed :dist :data (get-dataset :cars) :legend true)
set-background-default
view)


(doto (scatter-plot :speed :dist :data (get-dataset :cars))
set-background-default
view)


(doto (box-plot (sample-gamma 1000 :shape 1 :rate 2)
:legend true)
view set-background-default
(add-box-plot (sample-gamma 1000 :shape 2 :rate 2))
(add-box-plot (sample-gamma 1000 :shape 3 :rate 2)))


(doto (bar-chart [:a :b :c] [10 20 30] :legend true)
view
set-background-default
(add-categories [:a :b :c] [5 25 40]))


(doto (line-chart [:a :b :c] [10 20 30] :legend true)
view
set-background-default
(add-categories [:a :b :c] [5 25 40]))

;; time-series-plot
(def epoch 0)
(defn num-years-to-milliseconds [x]
(* 365 24 60 60 1000 x))
(def dates (map num-years-to-milliseconds (range 100)))
(def chart1 (time-series-plot dates (range 100)))
(def cw1 (view chart1))
(add-lines chart1 dates (mult 1/2 (range 100)))

(def chart2 (time-series-plot (take 10 dates) (mult 1/2 (range 10))))
(def cw2 (view chart2))


0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source incanter/charts.clj:61 top

(defmulti set-background-default 
"

  Examples:
    (use '(incanter core stats charts datasets))

    (doto (histogram (sample-normal 1000) :title (str :Test-Tittle))
      set-theme-bw
      view)

 
    (doto (histogram (sample-normal 1000))
      set-background-default
      (add-histogram (sample-normal 1000 :mean 1))
      view)


    (doto (scatter-plot :speed :dist :data (get-dataset :cars))
      set-theme-bw
      view)

    (doto (scatter-plot :speed :dist :data (get-dataset :cars))
      set-theme-bw
      (set-stroke :dash 5)
      (add-points (plus ($ :speed (get-dataset :cars)) 5) (plus ($ :dist (get-dataset :cars)) 10))
      view)

    (doto (scatter-plot :speed :dist :data (get-dataset :cars))
      set-background-default
      (set-stroke :dash 5)
      (add-function sin 0 25)
      view)


    (doto (xy-plot :speed :dist :data (get-dataset :cars) :legend true)
      set-background-default
      view)


    (doto (scatter-plot :speed :dist :data (get-dataset :cars))
      set-background-default
      view)

   
    (doto (box-plot (sample-gamma 1000 :shape 1 :rate 2)
                    :legend true)
      view set-background-default
      (add-box-plot (sample-gamma 1000 :shape 2 :rate 2))
      (add-box-plot (sample-gamma 1000 :shape 3 :rate 2)))


    (doto (bar-chart [:a :b :c] [10 20 30] :legend true)
      view
      set-background-default
      (add-categories [:a :b :c] [5 25 40]))
  

    (doto (line-chart [:a :b :c] [10 20 30] :legend true)
      view
      set-background-default
      (add-categories [:a :b :c] [5 25 40]))
 
    ;; time-series-plot
    (def epoch 0)
    (defn num-years-to-milliseconds [x]
      (* 365 24 60 60 1000 x))
    (def dates (map num-years-to-milliseconds (range 100)))
    (def chart1 (time-series-plot dates (range 100)))
    (def cw1 (view chart1))
    (add-lines chart1 dates (mult 1/2 (range 100)))

    (def chart2 (time-series-plot (take 10 dates) (mult 1/2 (range 10))))
    (def cw2 (view chart2))


"
(fn [chart] (type (.getPlot chart))))
Vars in incanter.charts/set-background-default: defmulti fn type
Used in 0 other vars

Comments top

No comments for set-background-default. Log in to add a comment.