Returns a JFreeChart object representing a box-plot of the given data.
Use the 'view' function to display the chart, or the 'save' function
to write it to a file.
Options:
:title (default 'Histogram') main title
:x-label (default x expression)
:y-label (default 'Frequency')
:legend (default false) prints legend
:series-label (default x expression)
:group-by (default nil) -- a vector of values used to group the x values into series.
See also:
view and save
Examples:
(use '(incanter core stats charts))
(def gamma-box-plot (box-plot (sample-gamma 1000 :shape 1 :rate 2)
:title "Gamma Boxplot"
:legend true))
(view gamma-box-plot)
(add-box-plot gamma-box-plot (sample-gamma 1000 :shape 2 :rate 2))
(add-box-plot gamma-box-plot (sample-gamma 1000 :shape 3 :rate 2))
;; use the group-by options
(use '(incanter core stats datasets charts))
(with-data (get-dataset :iris)
(view (box-plot :Petal.Length :group-by :Species :legend true))
(view (box-plot :Petal.Width :group-by :Species :legend true))
(view (box-plot :Sepal.Length :group-by :Species :legend true))
(view (box-plot :Sepal.Width :group-by :Species :legend true)))
;; see INCANTER_HOME/examples/probability_plots.clj for more examples of plots
References:
http://www.jfree.org/jfreechart/api/javadoc/
http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/JFreeChart.html
Comments top
No comments for box-plot. Log in to add a comment.