Customizing charts with JFreeChart
Incanter's chart API is easy to use and provides a powerful wrapper around JFreeChart (http://www.jfree.org/jfreechart/). However, it doesn't expose JFreeChart's full variety of chart types or all the options that JFreeChart provides. In order to access those, we have to dive from Incanter's API into the JFreeChart objects. Fortunately, that's quite easy to do. Let's see how.
Getting ready
We'll use the same dependencies in our project.clj
file as we did in Creating scatter plots with Incanter.
We'll use this set of imports in our script or REPL:
(require '[incanter.core :as i] '[incanter.charts :as c] 'incanter.datasets) (import org.jfree.chart.renderer.category.LayeredBarRenderer org.jfree.util.SortOrder)
We'll use the Iris dataset again. Here's how to load it in Incanter:
(def iris (incanter.datasets/get-dataset :iris))
How to do it...
For this recipe, we'll create...