Skip to content

Commit

Permalink
changed tutorial to write files to /tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
daslu committed Apr 24, 2024
1 parent 7b41885 commit 42b0d7a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions notebooks/clojisr/v1/tutorials/main.clj
Original file line number Diff line number Diff line change
Expand Up @@ -479,13 +479,15 @@ of [libpython-clj](https://github.com/cnuernber/libpython-clj)

(md "Any plot (function or object) can be saved to file or converted to BufferedImage object.")

(let [path "notebooks/generated-images/histogram.jpg"]
(let [path "/tmp/histogram.jpg"]
(r->clj (plot->file path
(fn [] (hist [1 1 1 1 2 3 4 5]
:main "Histogram"
:xlab "data: [1 1 1 1 2 3 4 5]"))
:width 800 :height 400 :quality 50))
(kind/hiccup [:image {:src path}]))
(-> (clojure.java.shell/sh "ls" path)
:out
kind/code))

(plot->buffered-image (fn [] (hist [1 1 1 1 2 3 4 5])) :width 222 :height 149)

Expand Down

0 comments on commit 42b0d7a

Please sign in to comment.