Skip to content

Commit

Permalink
Add a matplotlib hy example, reproduces a weird hanging issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Olical committed Mar 13, 2021
1 parent 03a10b9 commit a6eb608
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions dev/hy/matplot-demo.hy
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
(+ 10 20)

(import matplotlib)
(.use matplotlib "Qt5Agg")
(.rcdefaults matplotlib)
(.use matplotlib "Qt5Agg")

(import [matplotlib [pyplot]])

(.ion pyplot)
(pyplot.style.use "default")
(pyplot.style.use "fivethirtyeight")

(defn test []
"Plot a list."
(setv fig (.figure pyplot))
(setv axes (.add_subplot fig))
(.plot axes (list (range 20)))
{:figure fig :axes axes})

(test)

0 comments on commit a6eb608

Please sign in to comment.