Customizing chart colors and styles
In the last recipe, we customized the type of chart and how the data is displayed and laid out. However, we'll often want to customize other things, such as the chart's color scheme or style.
In this recipe, we'll take a chart that we created for another recipe and change the way it looks. This will give an example of how to customize the color and other parts of how the chart displays.
Getting ready
We'll use the same dependencies in our project.clj
file as we did in Creating scatter plots with Incanter, and this set of imports in our script or REPL:
(require '[incanter.core :as i] '[incanter.charts :as c] '[incanter.io :as iio] '[incanter.stats :as s]) (import org.jfree.chart.renderer.category.LayeredBarRenderer org.jfree.util.SortOrder)
We'll start with the chart we made in Adding lines to scatter charts. We'll keep it assigned to the iris-petal-scatter
variable.