Does anyone know how to add a shaded polygon to a plot? Ideally, I'd just like to shade an area under my function.
Seems like you can set the fill paint via the ctor http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/annotations/XYPolygonAnnotation.html#XYPolygonAnnotation-double:A-java.awt.Stroke-java.awt.Paint-java.awt.Paint- but not in Clojure wrapper function: https://github.com/incanter/incanter/blob/master/modules/incanter-charts/src/incanter/charts.clj#L3232
For those interested, I ended up writing my own version of add-polygon:
(defn add-polygon
[chart coords & options]
(let [{:keys [stroke outline-paint fill-paint]
:or {stroke (BasicStroke. 1.0)
outline-paint Color/BLACK
fill-paint nil}} (when options (apply assoc {} options))
points (double-array (mapcat identity coords))
anno (XYPolygonAnnotation. points stroke outline-paint fill-paint)]
(.addAnnotation (.getPlot chart) anno)
chart))