(->bins x-min x-bin-width y-min y-bin-width bin-w bin-p)
(add-domain-interval-marker chart x y label)
(add-domain-marker chart x label)
(add-function chart function min-range max-range & options)
Adds a xy-plot of the given function to the given chart, returning a modified version of the chart. Options: :series-label (default x expression) :step-size (default (/ (- max-range min-range) 500)) See also: function-plot, view, save, add-function, add-points, add-lines Examples: (use '(incanter core stats charts)) ;; plot the sine and cosine functions (doto (function-plot sin (- Math/PI) Math/PI) (add-function cos (- Math/PI) Math/PI) view) ;; plot two normal pdf functions (doto (function-plot pdf-normal -3 3 :legend true) (add-function (fn [x] (pdf-normal x :mean 0.5 :sd 0.5)) -3 3) view) ;; plot a user defined function and its derivative (use '(incanter core charts optimize)) ;; define the function, x^3 + 2x^2 + 2x + 3 (defn cubic [x] (+ (* x x x) (* 2 x x) (* 2 x) 3)) ;; use the derivative function to get a function ;; that approximates its derivative (def deriv-cubic (derivative cubic)) ;; plot the cubic function and its derivative (doto (function-plot cubic -10 10) (add-function deriv-cubic -10 10) view)
Adds a xy-plot of the given function to the given chart, returning a modified version of the chart. Options: :series-label (default x expression) :step-size (default (/ (- max-range min-range) 500)) See also: function-plot, view, save, add-function, add-points, add-lines Examples: (use '(incanter core stats charts)) ;; plot the sine and cosine functions (doto (function-plot sin (- Math/PI) Math/PI) (add-function cos (- Math/PI) Math/PI) view) ;; plot two normal pdf functions (doto (function-plot pdf-normal -3 3 :legend true) (add-function (fn [x] (pdf-normal x :mean 0.5 :sd 0.5)) -3 3) view) ;; plot a user defined function and its derivative (use '(incanter core charts optimize)) ;; define the function, x^3 + 2x^2 + 2x + 3 (defn cubic [x] (+ (* x x x) (* 2 x x) (* 2 x) 3)) ;; use the derivative function to get a function ;; that approximates its derivative (def deriv-cubic (derivative cubic)) ;; plot the cubic function and its derivative (doto (function-plot cubic -10 10) (add-function deriv-cubic -10 10) view)
(add-function* chart function min-range max-range & options)
(add-lines chart x y & options)
Plots lines on the given scatter or line plot (xy-plot) of the (x,y) points. Equivalent to R's lines function, returns the modified chart object. Options: :series-label (default x expression) :points (default false) :auto-sort (default true) sort data by x Examples: (use '(incanter core stats io datasets charts)) (def cars (to-matrix (get-dataset :cars))) (def y (sel cars :cols 0)) (def x (sel cars :cols 1)) (def plot1 (scatter-plot x y :legend true)) (view plot1) ;; add regression line to scatter plot (def lm1 (linear-model y x)) (add-lines plot1 x (:fitted lm1)) ;; model the data without an intercept (def lm2 (linear-model y x :intercept false)) (add-lines plot1 x (:fitted lm2)) ;; Clojure's doto macro can be used to build a chart (doto (histogram (sample-normal 1000) :density true) (add-lines (range -3 3 0.05) (pdf-normal (range -3 3 0.05))) view) (with-data (get-dataset :iris) (doto (xy-plot :Sepal.Width :Sepal.Length :legend true) (add-lines :Petal.Width :Petal.Length) view)) References: http://www.jfree.org/jfreechart/api/javadoc/ http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/JFreeChart.html
Plots lines on the given scatter or line plot (xy-plot) of the (x,y) points. Equivalent to R's lines function, returns the modified chart object. Options: :series-label (default x expression) :points (default false) :auto-sort (default true) sort data by x Examples: (use '(incanter core stats io datasets charts)) (def cars (to-matrix (get-dataset :cars))) (def y (sel cars :cols 0)) (def x (sel cars :cols 1)) (def plot1 (scatter-plot x y :legend true)) (view plot1) ;; add regression line to scatter plot (def lm1 (linear-model y x)) (add-lines plot1 x (:fitted lm1)) ;; model the data without an intercept (def lm2 (linear-model y x :intercept false)) (add-lines plot1 x (:fitted lm2)) ;; Clojure's doto macro can be used to build a chart (doto (histogram (sample-normal 1000) :density true) (add-lines (range -3 3 0.05) (pdf-normal (range -3 3 0.05))) view) (with-data (get-dataset :iris) (doto (xy-plot :Sepal.Width :Sepal.Length :legend true) (add-lines :Petal.Width :Petal.Length) view)) References: http://www.jfree.org/jfreechart/api/javadoc/ http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/JFreeChart.html
(add-mouse-listener chart)
Toggle color of a line by clicking on it's legend entry or the line itself.
Toggle color of a line by clicking on it's legend entry or the line itself.
(add-sub-title chart text)
Add a subtitle to the chart.
Add a subtitle to the chart.
(add-value-marker chart y label & [idx])
(clear-domain-markers chart)
(clear-value-markers chart)
(close chart-frame)
(combined-domain-chart charts & {:keys [keep-titles] :or {keep-titles true}})
(combined-domain-plot & plots)
Combine several XYPlots into one plot with a common domain axis (all charts in one column).
Combine several XYPlots into one plot with a common domain axis (all charts in one column).
(combined-range-plot & plots)
Combine several XYPlots into one plot with a common range axis (all charts in one row).
Combine several XYPlots into one plot with a common range axis (all charts in one row).
(create-3d-dataset data label)
(create-paint-scale colors min-z max-z default-color)
(create-renderer)
do not plot a line when at least 3 values are missing (for example during the night)
do not plot a line when at least 3 values are missing (for example during the night)
(deviation-plot xs
vs
lower
upper
&
{:keys [series-label legend x-label y-label title fill-color-fn]
:or {legend false
series-label ""
title "Chart"
x-label "x"
y-label "y"
fill-color-fn (fn fill-color-fn [col] (.brighter col))}})
Create xy-plot of xs and vs, render minima and maxima as an area behind the line.
Create xy-plot of xs and vs, render minima and maxima as an area behind the line.
(function-plot function min-range max-range & options)
Returns a xy-plot object of the given function over the range indicated by the min-range and max-range arguments. Use the 'view' function to display the chart, or the 'save' function to write it to a file. Options: :title (default '') main title :x-label (default x expression) :y-label (default 'Frequency') :legend (default false) prints legend :series-label (default x expression) :step-size (default (/ (- max-range min-range) 500)) See also: view, save, add-points, add-lines Examples: (use '(incanter core stats charts)) (view (function-plot sin (- Math/PI) Math/PI)) (view (function-plot pdf-normal -3 3)) (defn cubic [x] (+ (* x x x) (* 2 x x) (* 2 x) 3)) (view (function-plot cubic -10 10))
Returns a xy-plot object of the given function over the range indicated by the min-range and max-range arguments. Use the 'view' function to display the chart, or the 'save' function to write it to a file. Options: :title (default '') main title :x-label (default x expression) :y-label (default 'Frequency') :legend (default false) prints legend :series-label (default x expression) :step-size (default (/ (- max-range min-range) 500)) See also: view, save, add-points, add-lines Examples: (use '(incanter core stats charts)) (view (function-plot sin (- Math/PI) Math/PI)) (view (function-plot pdf-normal -3 3)) (defn cubic [x] (+ (* x x x) (* 2 x x) (* 2 x) 3)) (view (function-plot cubic -10 10))
(function-plot* function min-range max-range & options)
Extract all instances of org.jfree.chart.XYPlot
Extract all instances of org.jfree.chart.XYPlot
(grid-apply f x-min x-max y-min y-max x-step y-step)
Applies the given function f, that accepts two arguments, to a grid defined by rectangle bounded x-min, y-min, x-max, y-max and returns a sequence of three sequences representing the cartesian product of x and y and z calculated by applying f to the combinations of x and y with step widths x-step and y-step.
Applies the given function f, that accepts two arguments, to a grid defined by rectangle bounded x-min, y-min, x-max, y-max and returns a sequence of three sequences representing the cartesian product of x and y and z calculated by applying f to the combinations of x and y with step widths x-step and y-step.
(heat-map function x-min x-max y-min y-max & options)
see incanter.charts/heat-map for examples Takes optional parameters :x-step and :y-step for x and y resolutions and :z-min :z-max for min./max. values of z.
see incanter.charts/heat-map for examples Takes optional parameters :x-step and :y-step for x and y resolutions and :z-min :z-max for min./max. values of z.
(heat-map* function x-min x-max y-min y-max & options)
(heat-map-data xs ys x-min x-max y-min y-max x-step y-step)
Create the data needed for calling chart-utils.jfreechart/set-heatmap-data. For details please refer to
chart-utils.jfreechart/heat-map`
Create the data needed for calling `chart-utils.jfreechart/set-heatmap-data. For details please refer to `chart-utils.jfreechart/heat-map`
(heat-map-function xs ys min-x max-x min-y max-y x-steps y-steps)
(histogram x & options)
Returns a JFreeChart object representing the histogram of the given data. Use the 'view' function to display the chart, or the 'save' function to write it to a file. Options: :nbins (default 10) number of bins :density (default false) if false, plots frequency, otherwise density :title (default 'Histogram') main title :x-label (default x expression) :y-label (default 'Frequency') :legend (default false) prints legend :series-label (default x expression) See also: view, save, add-histogram Examples: (use '(incanter core charts stats)) (view (histogram (sample-normal 1000)))
(def hist (histogram (sample-normal 1000) :density true)) (view hist)
(def x (range -4 4 0.01)) (add-lines hist x (pdf-normal x))
(def gam-hist (histogram (sample-gamma 1000) :density true :nbins 30)) (view gam-hist) (def x (range 0 8 0.01)) (add-lines gam-hist x (pdf-gamma x)) (use 'incanter.datasets) (def iris (get-dataset :iris)) (view (histogram :Sepal.Width :data iris)) (with-data (get-dataset :iris) (view (histogram :Petal.Length))) References: http://www.jfree.org/jfreechart/api/javadoc/ http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/JFreeChart.html
Returns a JFreeChart object representing the histogram of the given data. Use the 'view' function to display the chart, or the 'save' function to write it to a file. Options: :nbins (default 10) number of bins :density (default false) if false, plots frequency, otherwise density :title (default 'Histogram') main title :x-label (default x expression) :y-label (default 'Frequency') :legend (default false) prints legend :series-label (default x expression) See also: view, save, add-histogram Examples: (use '(incanter core charts stats)) (view (histogram (sample-normal 1000))) # plot a density histogram (def hist (histogram (sample-normal 1000) :density true)) (view hist) # add a normal density line to the plot (def x (range -4 4 0.01)) (add-lines hist x (pdf-normal x)) # plot some gamma data (def gam-hist (histogram (sample-gamma 1000) :density true :nbins 30)) (view gam-hist) (def x (range 0 8 0.01)) (add-lines gam-hist x (pdf-gamma x)) (use 'incanter.datasets) (def iris (get-dataset :iris)) (view (histogram :Sepal.Width :data iris)) (with-data (get-dataset :iris) (view (histogram :Petal.Length))) References: http://www.jfree.org/jfreechart/api/javadoc/ http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/JFreeChart.html
(histogram* x & options)
(line-chart categories values & options)
Returns a JFreeChart object representing a line-chart of the given values and categories. Use the 'view' function to display the chart, or the 'save' function to write it to a file. Arguments: categories -- a sequence of categories values -- a sequence of numeric values Options: :title (default '') main title :x-label (default 'Categories') :y-label (default 'Value') :legend (default false) prints legend :series-label :group-by (default nil) -- a vector of values used to group the values into series within each category. :gradient? (default false) -- use gradient on bars See also: view and save Examples: (use '(incanter core stats charts datasets)) (def data (get-dataset :airline-passengers)) (def years (sel data :cols 0)) (def months (sel data :cols 2)) (def passengers (sel data :cols 1)) (view (line-chart years passengers :group-by months :legend true)) (view (line-chart months passengers :group-by years :legend true)) (def seasons (mapcat identity (repeat 3 ["winter" "spring" "summer" "fall"]))) (def years (mapcat identity (repeat 4 [2007 2008 2009]))) (def x (sample-uniform 12 :integers true :max 100)) (view (line-chart years x :group-by seasons :legend true)) (view (line-chart ["a" "b" "c" "d" "e" "f"] [10 20 30 10 40 20])) (view (line-chart (sample "abcdefghij" :size 10 :replacement true) (sample-uniform 10 :max 50) :legend true)) ;; add a series label (def plot (line-chart ["a" "b" "c"] [10 20 30] :legend true :series-label "s1")) (view plot) (add-categories plot ["a" "b" "c"] [5 25 40] :series-label "s2") (view (line-chart :year :passengers :group-by :month :legend true :data data)) (view (line-chart :month :passengers :group-by :year :legend true :data data)) (with-data data (view (line-chart :month :passengers :group-by :year :legend true))) (with-data (->> ($rollup :sum :passengers :year (get-dataset :airline-passengers)) ($order :year :asc)) (view (line-chart :year :passengers))) (with-data (->> ($rollup :sum :passengers :month (get-dataset :airline-passengers)) ($order :passengers :asc)) (view (line-chart :month :passengers))) (with-data ($rollup :sum :passengers :month (get-dataset :airline-passengers)) (view (line-chart :month :passengers))) References: http://www.jfree.org/jfreechart/api/javadoc/ http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/JFreeChart.html
Returns a JFreeChart object representing a line-chart of the given values and categories. Use the 'view' function to display the chart, or the 'save' function to write it to a file. Arguments: categories -- a sequence of categories values -- a sequence of numeric values Options: :title (default '') main title :x-label (default 'Categories') :y-label (default 'Value') :legend (default false) prints legend :series-label :group-by (default nil) -- a vector of values used to group the values into series within each category. :gradient? (default false) -- use gradient on bars See also: view and save Examples: (use '(incanter core stats charts datasets)) (def data (get-dataset :airline-passengers)) (def years (sel data :cols 0)) (def months (sel data :cols 2)) (def passengers (sel data :cols 1)) (view (line-chart years passengers :group-by months :legend true)) (view (line-chart months passengers :group-by years :legend true)) (def seasons (mapcat identity (repeat 3 ["winter" "spring" "summer" "fall"]))) (def years (mapcat identity (repeat 4 [2007 2008 2009]))) (def x (sample-uniform 12 :integers true :max 100)) (view (line-chart years x :group-by seasons :legend true)) (view (line-chart ["a" "b" "c" "d" "e" "f"] [10 20 30 10 40 20])) (view (line-chart (sample "abcdefghij" :size 10 :replacement true) (sample-uniform 10 :max 50) :legend true)) ;; add a series label (def plot (line-chart ["a" "b" "c"] [10 20 30] :legend true :series-label "s1")) (view plot) (add-categories plot ["a" "b" "c"] [5 25 40] :series-label "s2") (view (line-chart :year :passengers :group-by :month :legend true :data data)) (view (line-chart :month :passengers :group-by :year :legend true :data data)) (with-data data (view (line-chart :month :passengers :group-by :year :legend true))) (with-data (->> ($rollup :sum :passengers :year (get-dataset :airline-passengers)) ($order :year :asc)) (view (line-chart :year :passengers))) (with-data (->> ($rollup :sum :passengers :month (get-dataset :airline-passengers)) ($order :passengers :asc)) (view (line-chart :month :passengers))) (with-data ($rollup :sum :passengers :month (get-dataset :airline-passengers)) (view (line-chart :month :passengers))) References: http://www.jfree.org/jfreechart/api/javadoc/ http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/JFreeChart.html
(line-chart* categories values & options)
(log-axis & options)
Create a logarithmic axis. Note: By default, values smaller than 0.5 are rounded to 0.5 to prevent strange behavior that happens for values close to 0. Options: :base (default 10) base of the logarithm; typically 2 or 10 :label (default none) the label of the axis :int-ticks? (default true) if true, use normal numbers instead of <base>^<exponent>, i.e. 1 instead of f.ex. 10^0.0 :smallest-value (default: 0.5) Set the smallest value represented by the axis, set to 0.0 to 'reset' See also: set-axis References: http://www.jfree.org/jfreechart/api/javadoc/ http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/axis/LogAxis.html
Create a logarithmic axis. Note: By default, values smaller than 0.5 are rounded to 0.5 to prevent strange behavior that happens for values close to 0. Options: :base (default 10) base of the logarithm; typically 2 or 10 :label (default none) the label of the axis :int-ticks? (default true) if true, use normal numbers instead of <base>^<exponent>, i.e. 1 instead of f.ex. 10^0.0 :smallest-value (default: 0.5) Set the smallest value represented by the axis, set to 0.0 to 'reset' See also: set-axis References: http://www.jfree.org/jfreechart/api/javadoc/ http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/axis/LogAxis.html
(map-to-axis chart series-idx axis-idx & {:keys [label position]})
Map dataseries to separate y axis. Reuses fonts, colors, paints from the first axis.
Map dataseries to separate y axis. Reuses fonts, colors, paints from the first axis.
(perf-set-data chart data series-idx)
Replace the data of a series without firing events for every single data point
by avoiding addOrUpdate
.
Replace the data of a series without firing events for every single data point by avoiding `addOrUpdate`.
(polar-plot angles
values
&
{:keys [series-label title legend]
:or {series-label "values" title "Polar chart" legend false}})
(remove-domain-interval-marker chart marker)
(remove-domain-marker chart marker)
(save chart filename & options)
From incanter https://github.com/incanter/incanter/blob/master/modules/incanter-charts/src/incanter/charts.clj#L3418
From incanter https://github.com/incanter/incanter/blob/master/modules/incanter-charts/src/incanter/charts.clj#L3418
Set the selected axis of the chart, returning the chart. (Beware: the axis' label will replace axis label set previously on the chart.) Arguments: chart - the JFreeChart object whose axis to change dimension - depends on the plot type for plots with mutliple axes f.ex. :x or :y for an XYPlot (x is the domain axis, y the range one) axis - the axis to set, an instance of ValueAxis See also: log-axis Note: Not applicable to DialPlot MeterPlot PiePlot MultiplePiePlot CompassPlot WaferMapPlot SpiderWebPlot References: http://www.jfree.org/jfreechart/api/javadoc/ http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/axis/ValueAxis.html http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/plot/XYPlot.html Examples: (use '(incanter core charts)) (view (doto (function-plot #(Math/pow 10 %) 0 5) (set-axis :x (log-axis :base 10, :label "log(x)"))))
Set the selected axis of the chart, returning the chart. (Beware: the axis' label will replace axis label set previously on the chart.) Arguments: chart - the JFreeChart object whose axis to change dimension - depends on the plot type for plots with mutliple axes f.ex. :x or :y for an XYPlot (x is the domain axis, y the range one) axis - the axis to set, an instance of ValueAxis See also: log-axis Note: Not applicable to DialPlot MeterPlot PiePlot MultiplePiePlot CompassPlot WaferMapPlot SpiderWebPlot References: http://www.jfree.org/jfreechart/api/javadoc/ http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/axis/ValueAxis.html http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/plot/XYPlot.html Examples: (use '(incanter core charts)) (view (doto (function-plot #(Math/pow 10 %) 0 5) (set-axis :x (log-axis :base 10, :label "log(x)"))))
(set-color chart series-idx color)
Set a java.awt.Color for each series with index series-idx
in charts.
Assumes that each renderer is responsible for one series only.
Set a java.awt.Color for each series with index `series-idx` in charts. Assumes that each renderer is responsible for one series only.
(set-discontinuous chart)
(set-heat-map-data chart data)
(set-paint-scale chart scale)
(set-plot-discontinuous plot)
(set-plot-discontinuous plot idx)
If there are more than 3 missing values in a series, do not connect points at this gap. Creates new renderers for the given series! If no series index is given, do this for all series of the plot.
If there are more than 3 missing values in a series, do not connect points at this gap. Creates new renderers for the given series! If no series index is given, do this for all series of the plot.
(set-step-renderer chart n)
Set an instance of org.jfree.chart.renderer.xy.XYStepRenderer
for data series n
.
Set an instance of `org.jfree.chart.renderer.xy.XYStepRenderer` for data series `n`.
(set-theme chart theme)
Changes the chart theme. Arguments: chart -- an Incanter/JFreeChart object theme -- either a keyword indicating one of the built-in themes, or a JFreeChart ChartTheme object. Built-in Themes: :default :dark Examples: (use '(incanter core charts)) (def chart (function-plot sin -4 4)) (view chart) ;; change the theme of chart to :dark (set-theme chart :dark) ;; change it back to the default (set-theme chart :default) ;; Example using JFreeTheme (use '(incanter core stats charts datasets)) (import '(org.jfree.chart StandardChartTheme) '(org.jfree.chart.plot DefaultDrawingSupplier) '(java.awt Color)) (def all-red-theme (doto (StandardChartTheme/createJFreeTheme) (.setDrawingSupplier (proxy [DefaultDrawingSupplier] [] (getNextPaint [] Color/red))))) (def data (get-dataset :airline-passengers)) (def chart (bar-chart :month :passengers :group-by :year :legend true :data data)) (doto chart ;; has no effect (set-theme all-red-theme) view) References: http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/StandardChartTheme.html http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/ChartTheme.html
Changes the chart theme. Arguments: chart -- an Incanter/JFreeChart object theme -- either a keyword indicating one of the built-in themes, or a JFreeChart ChartTheme object. Built-in Themes: :default :dark Examples: (use '(incanter core charts)) (def chart (function-plot sin -4 4)) (view chart) ;; change the theme of chart to :dark (set-theme chart :dark) ;; change it back to the default (set-theme chart :default) ;; Example using JFreeTheme (use '(incanter core stats charts datasets)) (import '(org.jfree.chart StandardChartTheme) '(org.jfree.chart.plot DefaultDrawingSupplier) '(java.awt Color)) (def all-red-theme (doto (StandardChartTheme/createJFreeTheme) (.setDrawingSupplier (proxy [DefaultDrawingSupplier] [] (getNextPaint [] Color/red))))) (def data (get-dataset :airline-passengers)) (def chart (bar-chart :month :passengers :group-by :year :legend true :data data)) (doto chart ;; has no effect (set-theme all-red-theme) view) References: http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/StandardChartTheme.html http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/ChartTheme.html
(set-title chart title)
Sets the main title of the plot, returns the modified chart object. References: http://www.jfree.org/jfreechart/api/javadoc/ http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/JFreeChart.html
Sets the main title of the plot, returns the modified chart object. References: http://www.jfree.org/jfreechart/api/javadoc/ http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/JFreeChart.html
(set-x-label chart label)
Sets the label of the x-axis, returns the modified chart object. References: http://www.jfree.org/jfreechart/api/javadoc/ http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/JFreeChart.html
Sets the label of the x-axis, returns the modified chart object. References: http://www.jfree.org/jfreechart/api/javadoc/ http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/JFreeChart.html
(set-x-range chart lower upper)
Sets the range of the x-axis on the given chart. Examples: (use '(incanter core charts datasets)) (def chart (xy-plot :speed :dist :data (get-dataset :cars))) (view chart) (set-x-range chart 10 20)
Sets the range of the x-axis on the given chart. Examples: (use '(incanter core charts datasets)) (def chart (xy-plot :speed :dist :data (get-dataset :cars))) (view chart) (set-x-range chart 10 20)
(set-y-label chart label)
Sets the label of the y-axis, returns the modified chart object. References: http://www.jfree.org/jfreechart/api/javadoc/ http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/JFreeChart.html
Sets the label of the y-axis, returns the modified chart object. References: http://www.jfree.org/jfreechart/api/javadoc/ http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/JFreeChart.html
(set-y-range chart idx lower upper)
(set-y-ranges chart lower upper)
Set y range for all available y-axes.
Set y range for all available y-axes.
(slider updater-fn slider-values)
(slider updater-fn slider-values slider-label)
Like incanter.charts/sliders* but returns the JSlider object only.
Like incanter.charts/sliders* but returns the JSlider object only.
(sliders [& slider-bindings] body)
Creates one slider control for each of the given sequence bindings. Each slider calls the given expression when manipulated.
Like incanter.charts/sliders but creates on frame that contains all sliders.
Creates one slider control for each of the given sequence bindings. Each slider calls the given expression when manipulated. Like incanter.charts/sliders but creates on frame that contains all sliders.
(sliders* f [& slider-values])
(sliders* f [& slider-values] [& slider-labels])
sliders*
Like incanter.charts/sliders* but creates one frame that contains all sliders.
sliders* Like incanter.charts/sliders* but creates one frame that contains all sliders.
(stacked-area-chart xs values & options)
(time-series-plot x y & options)
Returns a JFreeChart object representing a time series plot of the given data. Use the 'view' function to display the chart, or the 'save' function to write it to a file. Sequence passed in for the x axis should be number of milliseconds from the epoch (1 January 1970). Options: :data (default nil) If the :data option is provided a dataset, column names can be used instead of sequences of data as arguments to xy-plot. :title (default '') main title :x-label (default x expression) :y-label (default y expression) :legend (default false) prints legend :series-label (default x expression) :group-by (default nil) -- a vector of values used to group the x and y values into series. See also: view, save, add-points, add-lines Examples: (use '(incanter core stats charts)) (require '[clj-time.core :refer [date-time]]) ;; plot numbers against years starting with 1900 (def dates (map #(-> (date-time (+ 1900 %)) .getMillis) (range 100))) (def y (range 100)) (view (time-series-plot dates y :x-label "Year")) References: http://www.jfree.org/jfreechart/api/javadoc/ http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/JFreeChart.html
Returns a JFreeChart object representing a time series plot of the given data. Use the 'view' function to display the chart, or the 'save' function to write it to a file. Sequence passed in for the x axis should be number of milliseconds from the epoch (1 January 1970). Options: :data (default nil) If the :data option is provided a dataset, column names can be used instead of sequences of data as arguments to xy-plot. :title (default '') main title :x-label (default x expression) :y-label (default y expression) :legend (default false) prints legend :series-label (default x expression) :group-by (default nil) -- a vector of values used to group the x and y values into series. See also: view, save, add-points, add-lines Examples: (use '(incanter core stats charts)) (require '[clj-time.core :refer [date-time]]) ;; plot numbers against years starting with 1900 (def dates (map #(-> (date-time (+ 1900 %)) .getMillis) (range 100))) (def y (range 100)) (view (time-series-plot dates y :x-label "Year")) References: http://www.jfree.org/jfreechart/api/javadoc/ http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/JFreeChart.html
(time-series-plot* x y & options)
(use-relative-time-axis chart)
Replace domain axis by relative date/time axis.
Replace domain axis by relative date/time axis.
(use-time-axis chart)
(use-time-axis chart start-hour end-hour)
Use DateAxis. If a start- and end-hour are specified only these hours will be shown.
Use DateAxis. If a start- and end-hour are specified only these hours will be shown.
(view chart & options)
From incanter https://github.com/incanter/incanter/blob/master/modules/incanter-charts/src/incanter/charts.clj#L3405
From incanter https://github.com/incanter/incanter/blob/master/modules/incanter-charts/src/incanter/charts.clj#L3405
(xy-plot)
(xy-plot x y & options)
Returns a JFreeChart object representing a xy-plot of the given data. Use the 'view' function to display the chart, or the 'save' function to write it to a file. Options: :data (default nil) If the :data option is provided a dataset, column names can be used instead of sequences of data as arguments to xy-plot. :title (default 'XY Plot') 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 and y values into series. :points (default false) includes point-markers :auto-sort (default true) sort data by x See also: view, save, add-points, add-lines Examples: (use '(incanter core stats charts)) ;; plot the cosine function (def x (range -1 5 0.01)) (def y (cos (mult 2 Math/PI x))) (view (xy-plot x y)) ;; plot gamma pdf with different parameters (def x2 (range 0 20 0.1)) (def gamma-plot (xy-plot x2 (pdf-gamma x2 :shape 1 :scale 2) :legend true :title "Gamma PDF" :y-label "Density")) (view gamma-plot) (add-lines gamma-plot x2 (pdf-gamma x2 :shape 2 :scale 2)) (add-lines gamma-plot x2 (pdf-gamma x2 :shape 3 :scale 2)) (add-lines gamma-plot x2 (pdf-gamma x2 :shape 5 :scale 1)) (add-lines gamma-plot x2 (pdf-gamma x2 :shape 9 :scale 0.5)) ;; use :group-by option (use '(incanter core charts datasets)) (with-data (get-dataset :chick-weight) (view (xy-plot :Time :weight :group-by :Chick))) ;; 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
Returns a JFreeChart object representing a xy-plot of the given data. Use the 'view' function to display the chart, or the 'save' function to write it to a file. Options: :data (default nil) If the :data option is provided a dataset, column names can be used instead of sequences of data as arguments to xy-plot. :title (default 'XY Plot') 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 and y values into series. :points (default false) includes point-markers :auto-sort (default true) sort data by x See also: view, save, add-points, add-lines Examples: (use '(incanter core stats charts)) ;; plot the cosine function (def x (range -1 5 0.01)) (def y (cos (mult 2 Math/PI x))) (view (xy-plot x y)) ;; plot gamma pdf with different parameters (def x2 (range 0 20 0.1)) (def gamma-plot (xy-plot x2 (pdf-gamma x2 :shape 1 :scale 2) :legend true :title "Gamma PDF" :y-label "Density")) (view gamma-plot) (add-lines gamma-plot x2 (pdf-gamma x2 :shape 2 :scale 2)) (add-lines gamma-plot x2 (pdf-gamma x2 :shape 3 :scale 2)) (add-lines gamma-plot x2 (pdf-gamma x2 :shape 5 :scale 1)) (add-lines gamma-plot x2 (pdf-gamma x2 :shape 9 :scale 0.5)) ;; use :group-by option (use '(incanter core charts datasets)) (with-data (get-dataset :chick-weight) (view (xy-plot :Time :weight :group-by :Chick))) ;; 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
(xy-plot* x y & options)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close