1.2.3-SNAPSHOT Arrow_down_16x16

dynamic-scatter-plot

incanter.charts

  • (dynamic-scatter-plot [& slider-bindings] expression & options)
Returns an scatter-plot bound to sliders (which tend to appear behind the chart).
See the sliders macro for more information.


Examples:

(use '(incanter core stats charts))

(let [x (range -3 3 0.1)]
(view (dynamic-scatter-plot [mean (range -3 3 0.1)
sd (range 0.1 10 0.1)]
[x (pdf-normal x :mean mean :sd sd)]
:title "Normal PDF Plot")))


(let [x (range -3 3 0.1)]
(view (dynamic-scatter-plot [mean (range -3 3 0.1)
sd (range 0.1 10 0.1)]
(for [xi x] [xi (pdf-normal xi :mean mean :sd sd)])
:title "Normal PDF Plot")))

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:2954 top

(defmacro dynamic-scatter-plot
" Returns an scatter-plot bound to sliders (which tend to appear behind the chart). 
  See the sliders macro for more information.


  Examples:

  (use '(incanter core stats charts))

  (let [x (range -3 3 0.1)]
    (view (dynamic-scatter-plot [mean (range -3 3 0.1)
		                 sd (range 0.1 10 0.1)]
	    [x (pdf-normal x :mean mean :sd sd)]
            :title \"Normal PDF Plot\")))


   (let [x (range -3 3 0.1)]
     (view (dynamic-scatter-plot [mean (range -3 3 0.1)
		                  sd (range 0.1 10 0.1)]
	    (for [xi x] [xi (pdf-normal xi :mean mean :sd sd)])
            :title \"Normal PDF Plot\")))

"
  ([[& slider-bindings] expression & options]
     `(let [chart# (scatter-plot [] [] ~@options)
	    sliders# (sliders ~(vec slider-bindings)
			      (set-data chart# ~expression))]
	(doall sliders#)
	(set-x-label chart# (str '~(first expression)))
	(set-y-label chart# (str '~(second expression))))))
Vars in incanter.charts/dynamic-scatter-plot: defmacro first second vec apply concat doall let list seq str vector
Used in 0 other vars

Comments top

No comments for dynamic-scatter-plot. Log in to add a comment.