Here is how to do it using MetaPict: #lang racket (require racket/draw metapict)
(set-curve-pict-size 300 300) ; width and height of image (ahlength 1.0) ; size of arrow head (define p (with-window (window -12 12 -12 12) ; xmin, xmax, ymin, ymax (draw (draw-arrow (curve (pt -10 0) -- (pt 10 0))) ; x-axis (draw-arrow (curve (pt 0 -10) -- (pt 0 10))) ; y-axis (label-rt "x" (pt 10.2 0)) ; label for x axis (label-top "y" (pt 0 10.2)) ; label for y axis (circle (pt 2 1) 3)))) ; center (2,1) radius 3 p ; show pict in repl (define (save-pict-as-svg p width height filename [exists 'replace]) (define dc (new svg-dc% [width width] [height height] [output filename] [exists exists])) (send dc start-doc "An SVG Test") ; a message (send dc start-page) (draw-pict p dc 0 0) (send dc end-page) (send dc end-doc)) (save-pict-as-svg p 300 300 "output.svg") 2017-10-23 21:04 GMT+02:00 Lawrence Bottorff <borg...@gmail.com>: > I'd like to use Racket to generate scalable (svg?) graphics like gnuplot > or GeoGebra does. For example, I'd like to create a cartesian coordinate > graph system, then draw functions on it. One thing in particular would be > to draw a graph of a circle based on the standard form of a circle, e.g., > x^2 + y^2 = r^2. Again, I'd prefer being able to create an svg file. Is > there a tutorial that might give me more insight than the reference pages > or the Quick: An Introduction to Racket with Pictures? Or am I barking up > the wrong tree? > > LB > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- -- Jens Axel Søgaard -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.