Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (ns test-chart
- (:require (incanter
- [core :as core]
- [stats :as stats]
- [charts :as charts]
- [io :as io]
- [datasets :as dset]))
- (:use clj-pdf.core))
- (defn test-plot
- []
- (let [x (1 2 3 4)
- y (1 3 5 7)
- plot1 (charts/scatter-plot x y)
- out (new java.io.ByteArrayOutputStream)]
- (ChartUtilities/writeScaledChartAsPNG out plot1 300 200 1 1)
- (.toByteArray out)))
- (pdf [{} [:table {} [:cell [:image {} (test-plot)]
- [:image {} (test-plot)]]]] "test.pdf")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement