Created
November 30, 2016 03:42
-
-
Save hexgnu/5421d283b493c783523f29adac3de135 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require plot) | |
(plot-font-size 24) | |
(plot-height 800) | |
(plot-width 800) | |
(define f (λ (x) (+ (* 3 x) 2 ))) | |
(define xs (range -30 30 0.1)) | |
(define ys (map | |
(lambda (x) | |
(+ | |
(f x) | |
(- (* 40 (random)) 20) | |
) | |
) | |
xs | |
)) | |
(plot | |
(list | |
(function (λ (x) (+ (* 3 x) 2 )) -30 30 #:label "f(x) = 3 * x + 2") | |
(points (map vector xs ys) #:sym 'dot #:size 10 #:label "f(x) +/- 20 * random") | |
) | |
#:x-label "" | |
#:y-label "" | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment