This Web
Other Webs
Schematics
Scheme Links
(module performance mzscheme (provide (all-defined)) (require (lib "plot.ss" "plot") (lib "list.ss") (lib "pregexp.ss") (lib "string.ss") (lib "class.ss")) (define data #<<EOF 300000: 113 184 301000: 113 184 302000: 112 184 303000: 118 187 304000: 117 185 305000: 113 187 306000: 113 187 307000: 113 186 308000: 113 208 309000: 125 195 310000: 114 188 311000: 107 202 EOF ) (define extracted-data (map (lambda (line) (map string->number (rest (pregexp-match #px"(\\d+):\\s*(\\d+)\\s*(\\d+)" line)))) (regexp-split "\n" data))) (define points1 (points (map (lambda (l) (vector (first l) (second l))) extracted-data) (sym 'circle) (color 'red))) (define points2 (points (map (lambda (l) (vector (first l) (third l))) extracted-data) (sym 'square) (color 'green))) ;; this is an image-snip (define graph (plot (mix points1 points2) (x-min 300000) (x-max 320000) (y-min 0) (y-max 300))) (define bitmap (send graph get-bitmap)) (define (save filename) (send bitmap save-file filename 'png)))