diff --git a/collects/plot/plot.scrbl b/collects/plot/plot.scrbl index 0f67aed418..34dad1f1de 100644 --- a/collects/plot/plot.scrbl +++ b/collects/plot/plot.scrbl @@ -274,14 +274,19 @@ viewed in the DrRacket interactions window. [#:title title string? ""] [#:fgcolor fgcolor (list/c byte? byte? byte) '(0 0 0)] [#:bgcolor bgcolor (list/c byte? byte? byte) '(255 255 255)] - [#:lncolor lncolor (list/c byte? byte? byte) '(255 0 0)]) + [#:lncolor lncolor (list/c byte? byte? byte) '(255 0 0)] + [#:out-file out-file (or/c path-string? output-port? #f) #f]) (is-a?/c snip%)]{ Plots @scheme[data] in 2-D, where @scheme[data] is generated by functions like @scheme[points] or @scheme[lines]. A @scheme[data] value is represented as a procedure that takes a -@scheme[2d-view%] instance and adds plot information to it.} +@scheme[2d-view%] instance and adds plot information to it. + +The result is a @racket[snip%] for the plot. If an @racket[#:out-file] +path or port is provided, the plot is also written as a PNG image to +the given path or port.} @defproc[(plot3d [data ((is-a?/c 3d-view%) . -> . void?)] [#:width width real? 400] diff --git a/collects/plot/view.rkt b/collects/plot/view.rkt index 288ad934a5..8d31beea9e 100644 --- a/collects/plot/view.rkt +++ b/collects/plot/view.rkt @@ -1,5 +1,7 @@ (module view mzscheme - (require plot/plplot plot/math mzlib/class mzlib/file mred mzlib/math) + (require plot/plplot plot/math mzlib/class mzlib/file + racket/draw racket/snip + mzlib/math) ;; including suggested fix from Doug Williams