Database Reference
In-Depth Information
(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.
How to do it...
For this example, we'll take the Iris petal scatter plot, with the line added, and we'll change the
color scheme for St. Patrick's Day (lots of green).
1.
First, we'll pick the colors that we want in the color scheme:
(def colors [(java.awt.Color. 0x00 0xb3 0x66)
(java.awt.Color. 0x80 0xff 0xc9)])
2.
Then we'll set the series color for each renderer on this chart:
(doseq [[i c] (map vector (range) colors)]
(.. iris-petal-scatter
getPlot
(getRenderer i)
(setSeriesPaint 0 c)))
3.
Finally, we'll just view it as we viewed the previous charts:
(i/view iris-petal-scatter)
This gives us the same chart as before, but with an updated color scheme.
The updated chart looks like the following:
 
Search WWH ::




Custom Search