Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2013
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (ns test-chart
  2. (:require    (incanter
  3.               [core :as core]
  4.               [stats :as stats]
  5.               [charts :as charts]
  6.               [io :as io]
  7.               [datasets :as dset]))
  8. (:use clj-pdf.core))
  9.  
  10. (defn test-plot
  11.  []
  12.  (let [x (1 2 3 4)
  13.        y (1 3 5 7)
  14.        plot1 (charts/scatter-plot x y)
  15.        out (new java.io.ByteArrayOutputStream)]
  16.     (ChartUtilities/writeScaledChartAsPNG out plot1 300 200 1 1)
  17.     (.toByteArray out)))
  18.  
  19. (pdf [{} [:table {} [:cell [:image {} (test-plot)]
  20.              [:image {} (test-plot)]]]] "test.pdf")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement