uniplot/demo.ss
2021-04-29 22:35:37 +02:00

17 lines
418 B
Scheme
Executable file
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env gxi
(export main)
(import :std/format
:std/misc/string
:dlozeve/fancy/format
:dlozeve/uniplot/lineplot)
(def (main . args)
(let* ((xs (iota 1000 0 0.01))
(ys1 (map cos xs))
(ys2 (map (lambda (x) (/ 1 (+ 0.5 x))) xs))
(ys3 (map (lambda (x) (sin (* 2 x))) xs)))
(displayln (line-plot [xs ys1 ys2 ys3]
xlabel: "time"
names: ["cos(time)" "1 / (time + 0.5)" "sin(2 × time)"]))))