Skip to content

Commit

Permalink
cleaup
Browse files Browse the repository at this point in the history
  • Loading branch information
daslu committed Jul 23, 2024
1 parent 1e38fd7 commit 4f63873
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions src/scicloj/noj/v1/vis/python.clj
Original file line number Diff line number Diff line change
Expand Up @@ -38,43 +38,3 @@
(-> path
slurp
kind/html)))


;; ## Using Python visualizations

;; Noj offers methods to include Python plots in [Kindly](https://scicloj.github.io/kindly-noted/kindly) visualizations: the `vis.python/with-pyplot` macro and the `vis.python/pyplot` function.

;; They are based on the [Parens for Pyplot](http://gigasquidsoftware.com/blog/2020/01/18/parens-for-pyplot/) blog post at Squid's blog.

(require-python '[numpy :as np]
'[numpy.random :as np.random]
'matplotlib.pyplot
'[seaborn :as sns]
'json)

(def sine-data
(-> {:x (range 0 (* 3 np/pi) 0.1)}
tc/dataset
(tc/add-column :y #(tcc/sin (:x %)))))

(vis.python/with-pyplot
(matplotlib.pyplot/plot
(:x sine-data)
(:y sine-data)))

(vis.python/pyplot
#(matplotlib.pyplot/plot
(:x sine-data)
(:y sine-data)))

;; https://seaborn.pydata.org/tutorial/introduction
(let [tips (sns/load_dataset "tips")]
(sns/set_theme)
(vis.python/pyplot
#(sns/relplot :data tips
:x "total_bill"
:y "tip"
:col "time"
:hue "smoker"
:style "smoker"
:size "size")))

0 comments on commit 4f63873

Please sign in to comment.