1.2.3-SNAPSHOT Arrow_down_16x16

histogram*

incanter.charts

  • (histogram* 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:1203 top

(defn histogram*
  ([x & options]
    (let [opts (if options (apply assoc {} options) {})
          data (:data opts)
	  _x (if (coll? x) (to-list x) ($ x data))
          nbins (or (:nbins opts) 10)
	  theme (or (:theme opts) :default)
          density? (true? (:density opts))
          main-title (or (:title opts) "")
          x-lab (or (:x-label opts) (str 'x))
          y-lab (or (:y-label opts)
                     (if density? "Density" "Frequency"))
          series-lab (or (:series-label opts) (str 'x))
          legend? (true? (:legend opts))
          dataset (HistogramDataset.)]
      (do
        (.addSeries dataset series-lab (double-array _x) nbins)
        (when density? (.setType dataset org.jfree.data.statistics.HistogramType/SCALE_AREA_TO_1))
        (let [chart (-> (org.jfree.chart.ChartFactory/createHistogram
			  main-title
			  x-lab
			  y-lab
			  dataset
			  org.jfree.chart.plot.PlotOrientation/VERTICAL
			  legend?		; no legend
			  true			; tooltips
			  false)
			(set-theme theme))]
	  chart)))))
Vars in incanter.charts/histogram*: defn double-array let when
Used in 0 other vars

Comments top

No comments for histogram*. Log in to add a comment.