plot tests adjusted and passed
svn: r9769
|
@ -61,12 +61,12 @@
|
|||
1 0 32 #"(lib \"text-snipclass.ss\" \"xml\")\0"
|
||||
1 0 15 #"test-case-box%\0"
|
||||
2 0 1 6 #"wxloc\0"
|
||||
00000000000 1 75 0 1 #"\0"
|
||||
00000000000 1 77 0 1 #"\0"
|
||||
0 75 1 #"\0"
|
||||
0 11 90 -1 90 -1 3 -1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 255 255 255 1 -1 0 9
|
||||
#"Standard\0"
|
||||
0 75 11 #" Monospace\0"
|
||||
0 11 90 -1 90 -1 3 -1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 255 255 255 1 -1 2 1
|
||||
0 14 90 -1 90 -1 3 -1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 255 255 255 1 -1 2 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 -1 -1 2 24
|
||||
|
@ -198,7 +198,22 @@
|
|||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 255 0 0 0 0 0 -1 -1 8 24
|
||||
#"drscheme:text:ports err\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 255 0 0 0 0 0 -1 -1 0 1
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 255 0 0 0 0 0 -1 -1 4 1
|
||||
#"\0"
|
||||
0 71 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 -1 -1 4 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0 0 0 1 1 1 0 0 255 0 0 0 -1 -1 4 1
|
||||
#"\0"
|
||||
0 71 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0 0 0 1 1 1 0 0 255 0 0 0 -1 -1 4 1
|
||||
#"\0"
|
||||
0 71 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 0 100 0 0 0 0 -1 -1 0 1
|
||||
#"\0"
|
||||
0 75 11 #" Monospace\0"
|
||||
0 11 90 -1 90 -1 3 -1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 255 255 255 1 -1 0 1
|
||||
#"\0"
|
||||
0 75 1 #"\0"
|
||||
0 12 90 -1 90 -1 3 -1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 255 255 255 1 -1 0 1
|
||||
|
@ -270,34 +285,16 @@
|
|||
1 0 -1 -1 94 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 255 0 0 0 0 0 -1 -1 2 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 200 0 0 0 0 0 -1 -1 4 1
|
||||
#"\0"
|
||||
0 71 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 -1 -1 4 1
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 200 0 0 0 0 0 -1 -1 0 1
|
||||
#"\0"
|
||||
0 -1 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0 0 0 1 1 1 0 0 255 0 0 0 -1 -1 4 1
|
||||
#"\0"
|
||||
0 71 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0 0 0 1 1 1 0 0 255 0 0 0 -1 -1 4 1
|
||||
#"\0"
|
||||
0 71 1 #"\0"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 0 100 0 0 0 0 -1 -1
|
||||
00000000002 0 00000000000 3 00000000000 159 0 22 3 1 #"("
|
||||
0 0 14 3 7 #"require"
|
||||
0 0 4 3 1 #" "
|
||||
0 0 22 3 1 #"("
|
||||
0 0 14 3 3 #"lib"
|
||||
0 0 4 3 1 #" "
|
||||
0 0 19 3 9 #"\"plot.ss\""
|
||||
0 0 4 3 1 #" "
|
||||
0 0 19 3 6 #"\"plot\""
|
||||
0 0 22 3 2 #"))"
|
||||
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 200 0 0 0 0 0 -1 -1
|
||||
00000000002 0 00000000000 3 00000000000 125 0 26 3 12 #"#lang scheme"
|
||||
0 0 4 29 1 #"\n"
|
||||
0 0 22 3 1 #"("
|
||||
0 0 14 3 7 #"require"
|
||||
0 0 4 3 1 #" "
|
||||
0 0 14 3 9 #"mzlib/etc"
|
||||
0 0 14 3 4 #"plot"
|
||||
0 0 22 3 1 #")"
|
||||
0 0 4 29 1 #"\n"
|
||||
0 0 4 29 1 #"\n"
|
||||
|
@ -332,6 +329,9 @@
|
|||
0 0 14 3 1 #"x"
|
||||
0 0 22 3 3 #")))"
|
||||
0 0 4 3 1 #" "
|
||||
0 0 17 3 25 #"; a random list of points"
|
||||
0 0 4 29 1 #"\n"
|
||||
0 0 4 3 7 #" "
|
||||
0 0 22 3 1 #"("
|
||||
0 0 14 3 10 #"build-list"
|
||||
0 0 4 3 1 #" "
|
||||
|
@ -349,43 +349,18 @@
|
|||
0 0 4 3 1 #" "
|
||||
0 0 14 3 1 #"x"
|
||||
0 0 22 3 5 #")))))"
|
||||
0 0 4 3 1 #" "
|
||||
0 0 17 3 1 #";"
|
||||
0 0 17 3 1 #" "
|
||||
0 0 17 3 1 #"a"
|
||||
0 0 17 3 1 #" "
|
||||
0 0 17 3 1 #"r"
|
||||
0 0 17 3 1 #"a"
|
||||
0 0 17 3 1 #"n"
|
||||
0 0 17 3 1 #"d"
|
||||
0 0 17 3 1 #"o"
|
||||
0 0 17 3 1 #"m"
|
||||
0 0 17 3 1 #" "
|
||||
0 0 17 3 1 #"l"
|
||||
0 0 17 3 1 #"i"
|
||||
0 0 17 3 1 #"s"
|
||||
0 0 17 3 1 #"t"
|
||||
0 0 17 3 1 #" "
|
||||
0 0 17 3 1 #"o"
|
||||
0 0 17 3 1 #"f"
|
||||
0 0 17 3 1 #" "
|
||||
0 0 17 3 1 #"p"
|
||||
0 0 17 3 1 #"o"
|
||||
0 0 17 3 1 #"i"
|
||||
0 0 17 3 3 #"nts"
|
||||
0 0 4 29 1 #"\n"
|
||||
0 0 4 3 1 #" "
|
||||
0 0 22 3 1 #"("
|
||||
0 0 14 3 5 #"x-max"
|
||||
0 0 22 3 1 #"#"
|
||||
0 0 22 3 6 #":x-max"
|
||||
0 0 4 3 1 #" "
|
||||
0 0 20 3 2 #"30"
|
||||
0 0 4 3 1 #" "
|
||||
0 0 22 3 1 #"#"
|
||||
0 0 22 3 6 #":y-max"
|
||||
0 0 4 3 1 #" "
|
||||
0 0 20 3 2 #"30"
|
||||
0 0 22 3 1 #")"
|
||||
0 0 4 3 1 #" "
|
||||
0 0 22 3 1 #"("
|
||||
0 0 14 3 5 #"y-max"
|
||||
0 0 4 3 1 #" "
|
||||
0 0 20 3 2 #"30"
|
||||
0 0 22 3 2 #"))"
|
||||
0 0 4 29 1 #"\n"
|
||||
0 0 4 29 1 #"\n"
|
||||
0 0 17 3 1 #";"
|
||||
|
@ -409,8 +384,7 @@
|
|||
0 0 17 3 1 #"n"
|
||||
0 0 17 3 1 #"g"
|
||||
0 0 17 3 1 #" "
|
||||
0 0 17 3 1 #"l"
|
||||
0 0 17 3 1 #"i"
|
||||
0 0 17 3 2 #"li"
|
||||
0 0 17 3 1 #"k"
|
||||
0 0 17 3 1 #"e"
|
||||
0 0 17 3 1 #" "
|
||||
|
@ -436,11 +410,9 @@
|
|||
0 0 17 3 1 #"r"
|
||||
0 0 17 3 1 #"e"
|
||||
0 0 17 3 1 #" "
|
||||
0 0 17 3 1 #"r"
|
||||
0 0 17 3 1 #"a"
|
||||
0 0 17 3 4 #"ndom"
|
||||
0 0 4 29 1 #"\n"
|
||||
0 0 17 3 6 #"random"
|
||||
0 0 4 29 1 #"\n"
|
||||
0 0 17 3 1 #";"
|
||||
0 3 00000000037 4 1 #"\0"
|
||||
2 -1 -1 0 0 0 00000000013 500
|
||||
(
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#lang scheme
|
||||
(require plot)
|
||||
|
||||
(require mzlib/class plot/plot-extend)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#lang scheme
|
||||
(require plot)
|
||||
(require mzlib/etc)
|
||||
|
||||
(plot (line identity (color 'red)))
|
||||
(plot (line (lambda (x) x) #:color 'red))
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#lang scheme
|
||||
(require plot)
|
||||
|
||||
(plot (line (lambda (x) (sin x)) (color 'red)))
|
||||
(plot (line sin #:color 'red))
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#lang scheme
|
||||
(require plot)
|
||||
|
||||
(plot
|
||||
(vector-field (gradient (lambda (x y) (* (sin x) (cos y)))) (samples 25))
|
||||
(title "gradient field of F(x,y) = sin(x) * sin(y)"))
|
||||
(plot (vector-field (gradient (lambda (x y) (* (sin x) (cos y)))) #:samples 25)
|
||||
#:title "gradient field of F(x,y) = sin(x) * sin(y)")
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#lang scheme
|
||||
(require plot)
|
||||
|
||||
|
||||
(define (trig x y) (* (sin x) (sin y)))
|
||||
(plot (shade trig)
|
||||
(x-min -1.5) (x-max 1.5) (y-min -1.5) (y-max 1.5)
|
||||
(title "shdade of F(x,y) = sin(x) * sin(y)"))
|
||||
#:x-min -1.5 #:x-max 1.5 #:y-min -1.5 #:y-max 1.5
|
||||
#:title "shdade of F(x,y) = sin(x) * sin(y)")
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
#lang scheme
|
||||
(require plot)
|
||||
|
||||
(define (trig x y) (* (sin x) (sin y)))
|
||||
|
||||
(plot (contour trig)
|
||||
(x-min -1.5) (x-max 1.5) (y-min -1.5) (y-max 1.5)
|
||||
(title "contours of F(x,y) = sin(x) * sin(y)"))
|
||||
#:x-min -1.5 #:x-max 1.5 #:y-min -1.5 #:y-max 1.5
|
||||
#:title "contours of F(x,y) = sin(x) * sin(y)")
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
#lang scheme
|
||||
(require plot)
|
||||
|
||||
(define (trig x y) (* (sin x) (sin y)))
|
||||
|
||||
(plot (vector-field (gradient trig) '((samples 25)))
|
||||
(x-min -1.5) (x-max 1.5) (y-min -1.5) (y-max 1.5)
|
||||
(title "gradient field of F(x,y) = sin(x) * sin(y)"))
|
||||
(plot (vector-field (gradient trig) #:samples 25)
|
||||
#:x-min -1.5 #:x-max 1.5 #:y-min -1.5 #:y-max 1.5
|
||||
#:title "gradient field of F(x,y) = sin(x) * sin(y)")
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
#lang scheme
|
||||
(require plot)
|
||||
|
||||
(define (trig x y) (* (sin x) (sin y)))
|
||||
|
||||
|
||||
(plot (mix
|
||||
(shade trig)
|
||||
(plot (mix (shade trig)
|
||||
(contour trig)
|
||||
(vector-field (gradient trig ) (samples 25)))
|
||||
(x-min -1.5) (x-max 1.5) (y-min -1.5) (y-max 1.5)
|
||||
(title "gradient field +shdade + contours of F(x,y) = sin(x) * sin(y)"))
|
||||
(vector-field (gradient trig) #:samples 25))
|
||||
#:x-min -1.5 #:x-max 1.5 #:y-min -1.5 #:y-max 1.5
|
||||
#:title "gradient field +shdade + contours of F(x,y) = sin(x) * sin(y)")
|
||||
|
||||
(plot3d (mesh3d trig)
|
||||
(x-min -3.5) (x-max 3.5) (y-min -3.5) (y-max 3.5) (z-min -1.0) (z-max 1.5) (bgcolor '(0 0 0)) (fgcolor '(255 0 0)))
|
||||
#:x-min -3.5 #:x-max 3.5 #:y-min -3.5 #:y-max 3.5 #:z-min -1.0 #:z-max 1.5
|
||||
#:bgcolor '(0 0 0) #:fgcolor '(255 0 0))
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#lang scheme
|
||||
(require plot)
|
||||
|
||||
(define x-vals (build-list 15 (lambda (x) x) ))
|
||||
|
@ -12,12 +13,12 @@
|
|||
|
||||
(define params
|
||||
(fit gues-fun
|
||||
((a 1) (b 1))
|
||||
'((a 1) (b 1))
|
||||
(map vector x-vals z-vals errors)))
|
||||
|
||||
(plot (mix
|
||||
(points (map vector x-vals z-vals))
|
||||
(line (lambda (x)
|
||||
(apply gues-fun x (fit-result-final-params params)))))
|
||||
(x-min -1) (x-max 20)
|
||||
(y-min -1) (y-max 10))
|
||||
#:x-min -1 #:x-max 20
|
||||
#:y-min -1 #:y-max 10)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
;; This is data from the Cavendish experiment
|
||||
#lang scheme
|
||||
|
||||
;; This is data from the Cavendish experiment
|
||||
(define raw-data
|
||||
'((0.0 -14.7 3.6)
|
||||
(1.0 8.6 3.6)
|
||||
|
@ -55,33 +56,24 @@
|
|||
|
||||
(require plot)
|
||||
|
||||
(plot (mix (points experemental-data (symbol 'circle))
|
||||
(plot (mix (points experemental-data #:sym 'circle)
|
||||
(error-bars experemental-data))
|
||||
(x-min 0) (x-max 40)
|
||||
(y-min -40) (y-max 50)
|
||||
(width 400) (height 300))
|
||||
#:x-min 0 #:x-max 40
|
||||
#:y-min -40 #:y-max 50
|
||||
#:width 400 #:height 300)
|
||||
|
||||
(define
|
||||
(theta x a tau phi T theta0)
|
||||
(+
|
||||
theta0
|
||||
(* a
|
||||
(exp (/ x tau -1))
|
||||
(sin (+ phi (/ (* 2 pi x) T))))))
|
||||
(define (theta x a tau phi T theta0)
|
||||
(+ theta0
|
||||
(* a (exp (/ x tau -1)) (sin (+ phi (/ (* 2 pi x) T))))))
|
||||
|
||||
(define result
|
||||
(fit
|
||||
theta
|
||||
((a 40) (tau 15) (phi -0.5) (T 15) (theta0 10))
|
||||
experemental-data))
|
||||
(fit theta '((a 40) (tau 15) (phi -0.5) (T 15) (theta0 10)) experemental-data))
|
||||
|
||||
|
||||
(plot (mix
|
||||
(points (map vector times vals) (symobol 'square) (color 'black))
|
||||
(plot (mix (points (map vector times vals) #:sym 'square #:color 'black)
|
||||
(error-bars experemental-data)
|
||||
(line (fit-result-function result) (color 'green)))
|
||||
(x-min -5) (x-max 40)
|
||||
(y-min -40) (y-max 50))
|
||||
(line (fit-result-function result) #:color 'green))
|
||||
#:x-min -5 #:x-max 40
|
||||
#:y-min -40 #:y-max 50)
|
||||
|
||||
(fit-result-final-params result)
|
||||
;(pretty-print result)
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
shade surface))
|
||||
(only-in "plot.ss"
|
||||
mix
|
||||
derivative gradient make-vec)
|
||||
derivative gradient make-vec
|
||||
mesh3d)
|
||||
(only-in "fit.ss" fit-int))
|
||||
|
||||
(provide plot
|
||||
|
@ -25,7 +26,8 @@
|
|||
mix
|
||||
derivative
|
||||
gradient
|
||||
make-vec)
|
||||
make-vec
|
||||
mesh3d)
|
||||
|
||||
(define-syntax-rule (out-fit-struct)
|
||||
(begin
|
||||
|
@ -50,6 +52,7 @@
|
|||
#:fgcolor [fgcolor '(0 0 0)]
|
||||
#:bgcolor [bgcolor '(255 255 255)]
|
||||
#:lncolor [lncolor '(255 0 0)]
|
||||
#:out-file [out-file #f]
|
||||
arg-extra ...)
|
||||
(orig:plot data
|
||||
[width width]
|
||||
|
@ -64,6 +67,7 @@
|
|||
[fgcolor fgcolor]
|
||||
[bgcolor bgcolor]
|
||||
[lncolor lncolor]
|
||||
[out-file out-file]
|
||||
init-extra ...)))
|
||||
|
||||
(define-plot plot orig:plot [] [])
|
||||
|
@ -114,11 +118,13 @@
|
|||
(define (vector-field f
|
||||
#:width [width 1]
|
||||
#:color [color 'red]
|
||||
#:style [style 'scaled])
|
||||
#:style [style 'scaled]
|
||||
#:samples [samples 20])
|
||||
(orig:vector-field f
|
||||
[width width]
|
||||
[color color]
|
||||
[style style]))
|
||||
[style style]
|
||||
[samples samples]))
|
||||
|
||||
(define (contour f
|
||||
#:samples [samples 50]
|
||||
|
|
|
@ -171,8 +171,7 @@
|
|||
plot-line
|
||||
plot-contours
|
||||
plot-shades
|
||||
fill
|
||||
)
|
||||
fill)
|
||||
|
||||
; set-labels : string string string -> nothing
|
||||
; sets the x, y and title lables
|
||||
|
|
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.9 KiB |
|
@ -1,24 +1,19 @@
|
|||
#!/bin/sh
|
||||
#|
|
||||
exec mred -u "$0" "$@"
|
||||
#| -*- scheme -*-
|
||||
exec mred "$0" "$@"
|
||||
|#
|
||||
(module run-tests mzscheme
|
||||
#lang scheme
|
||||
(require plot mzlib/md5)
|
||||
|
||||
(require plot
|
||||
mzlib/md5
|
||||
mzlib/pretty)
|
||||
|
||||
|
||||
;; thisi should be big enough to read thse files
|
||||
(define (read-file file)
|
||||
(with-input-from-file file (lambda () (read-bytes 100000))))
|
||||
(with-input-from-file file (lambda () (read-bytes (file-size file)))))
|
||||
|
||||
(define-syntax run-test
|
||||
(syntax-rules ()
|
||||
[(_ description (plot args ...) file-name)
|
||||
(let* ([result-file-name (string-append file-name "-out.png")]
|
||||
[expected-file-name (string-append file-name ".png")])
|
||||
(plot args ... (out-file result-file-name))
|
||||
(plot args ... #:out-file result-file-name)
|
||||
;; WILL COMPARE by MD5 hash.
|
||||
(printf "testing \"~a\" ... " description)
|
||||
(if (equal? (md5 (read-file result-file-name))
|
||||
|
@ -28,60 +23,47 @@ exec mred -u "$0" "$@"
|
|||
expected-file-name
|
||||
result-file-name)))]))
|
||||
|
||||
|
||||
(run-test "Line"
|
||||
(plot
|
||||
(line (lambda (x) x) (color 'red)))
|
||||
(plot (line (lambda (x) x) #:color 'red))
|
||||
"red-identity")
|
||||
|
||||
|
||||
|
||||
(run-test
|
||||
"Vector Field"
|
||||
(plot
|
||||
(vector-field
|
||||
(gradient (lambda (x y) (* (sin x) (cos y))))
|
||||
(samples 25))
|
||||
(title "gradient field of F(x,y) = sin(x) * sin(y)"))
|
||||
(run-test "Vector Field"
|
||||
(plot (vector-field (gradient (lambda (x y) (* (sin x) (cos y))))
|
||||
#:samples 25)
|
||||
#:title "gradient field of F(x,y) = sin(x) * sin(y)")
|
||||
"vector-field")
|
||||
|
||||
(define (trig x y) (* (sin x) (sin y)))
|
||||
|
||||
(run-test
|
||||
"Shading"
|
||||
(run-test "Shading"
|
||||
(plot (shade trig)
|
||||
(x-min -1.5) (x-max 1.5) (y-min -1.5) (y-max 1.5)
|
||||
(title "shdade of F(x,y) = sin(x) * sin(y)"))
|
||||
#:x-min -1.5 #:x-max 1.5 #:y-min -1.5 #:y-max 1.5
|
||||
#:title "shdade of F(x,y) = sin(x) * sin(y)")
|
||||
"shade")
|
||||
|
||||
(run-test
|
||||
"Contours"
|
||||
(run-test "Contours"
|
||||
(plot (contour trig)
|
||||
(x-min -1.5) (x-max 1.5) (y-min -1.5) (y-max 1.5)
|
||||
(title "contours of F(x,y) = sin(x) * sin(y)"))
|
||||
#:x-min -1.5 #:x-max 1.5 #:y-min -1.5 #:y-max 1.5
|
||||
#:title "contours of F(x,y) = sin(x) * sin(y)")
|
||||
"contours")
|
||||
|
||||
(run-test
|
||||
"Mix of all three"
|
||||
(plot (mix
|
||||
(shade trig)
|
||||
(run-test "Mix of all three"
|
||||
(plot (mix (shade trig)
|
||||
(contour trig)
|
||||
(vector-field (gradient trig ) (samples 25)))
|
||||
(x-min -1.5) (x-max 1.5) (y-min -1.5) (y-max 1.5)
|
||||
(title
|
||||
"gradient field +shdade + contours of F(x,y) = sin(x) * sin(y)"))
|
||||
(vector-field (gradient trig) #:samples 25))
|
||||
#:x-min -1.5 #:x-max 1.5 #:y-min -1.5 #:y-max 1.5
|
||||
#:title "gradient field & shade & contours")
|
||||
"mix")
|
||||
|
||||
(run-test
|
||||
"3d mesg"
|
||||
(run-test "3d mesg"
|
||||
(plot3d (mesh3d trig)
|
||||
(x-min -3.5) (x-max 3.5) (y-min -3.5) (y-max 3.5) (z-min -1.0) (z-max 1.5) (bgcolor '(0 0 0)) (fgcolor '(255 0 0)))
|
||||
#:x-min -3.5 #:x-max 3.5
|
||||
#:y-min -3.5 #:y-max 3.5
|
||||
#:z-min -1.0 #:z-max 1.5
|
||||
#:bgcolor '(0 0 0) #:fgcolor '(255 0 0))
|
||||
"3d-mesh")
|
||||
|
||||
(require mzlib/class
|
||||
(lib "plot-extend.ss" "plot")
|
||||
mzlib/etc)
|
||||
|
||||
(require plot/plot-extend)
|
||||
|
||||
; (number -> number) mumbo-jumbo -> 2d-renderer
|
||||
(define-plot-type dashed-line
|
||||
|
@ -101,14 +83,10 @@ exec mred -u "$0" "$@"
|
|||
(map (lambda (x) (vector x (fun x))) dash)))
|
||||
x-lists)))
|
||||
|
||||
(run-test
|
||||
"Simple plot-extend"
|
||||
(plot (dashed-line (lambda (x) x) (color 'red)))
|
||||
(run-test "Simple plot-extend"
|
||||
(plot (dashed-line (lambda (x) x) [color 'red]))
|
||||
"dashed-line")
|
||||
|
||||
(run-test
|
||||
"canvas sizing"
|
||||
(plot (line sin) (height 100) (width 100))
|
||||
(run-test "canvas sizing"
|
||||
(plot (line sin) #:height 100 #:width 100)
|
||||
"size")
|
||||
|
||||
)
|
||||
|
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 7.1 KiB |