incanter

kenny 2017-01-16T23:28:33.000017Z

Does anyone know how to add a shaded polygon to a plot? Ideally, I'd just like to shade an area under my function.

kenny 2017-01-16T23:43:57.000020Z

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))