1.2.3-SNAPSHOT permalink Arrow_down_16x16

box-plot*

incanter.charts

  • (box-plot* x & options)

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

(defn box-plot*
  ([x & options]
    (let [opts (when options (apply assoc {} options))
	  data (:data opts)
	  _x (if (coll? x) (to-list x) ($ x data))
	  _group-by (when (:group-by opts) 
		      (if (coll? (:group-by opts)) 
			(to-list (:group-by opts))
			($ (:group-by opts) data)))
	  x-groups (when _group-by 
		     (map #($ :col-0 %) 
			  (vals ($group-by :col-1 (conj-cols _x _group-by)))))
	  __x (if x-groups
                (first x-groups)
                _x)
	  main-title (or (:title opts) "")
	  x-label (or (:x-label opts) "")
	  y-label (or (:y-label opts) (str 'x))
	  series-label (or (:series-label opts) (str 'x))
	  category-label (or (:category-label opts) 0)
	  group-labels (:group-labels opts)
	  theme (or (:theme opts) :default)
	  legend? (true? (:legend opts))
	  dataset (DefaultBoxAndWhiskerCategoryDataset.)
	  chart (org.jfree.chart.ChartFactory/createBoxAndWhiskerChart
		 main-title
		 x-label
		 y-label
		 dataset
		 legend?)]
        (do
          (-> chart .getCategoryPlot .getRenderer (.setMaximumBarWidth 0.25))
          (.add dataset __x 
		(if _group-by 
		  (str series-label " (0)") 
		  series-label) 
		category-label)
          (when-not (empty? (rest x-groups))
            (doseq [i (range 1 (count x-groups))] 
	      (.add dataset 
		    (nth x-groups i) 
		    (str series-label " (" i ")") i)))
          (set-theme chart theme)
	  chart))))
Vars in incanter.charts/box-plot*: -> defn doseq empty? let nth rest str when-not
Used in 0 other vars

Comments top

No comments for box-plot*. Log in to add a comment.