The plotting procedures exported by plot/no-gui produce bitmap% and pict instances, and write to files. They do not require racket/gui, so they work in headless environments; for example, a Linux terminal with DISPLAY unset.
The plot module re-exports everything exported by plot/no-gui, as well as plot , plot3d , and other procedures that create interactive plots and plot frames. Interactive plotting procedures can always be imported, but fail when called if there is no working display or racket/gui is not present.
Each 3D plotting procedure behaves the same way as its corresponding 2D procedure, but takes the additional keyword arguments #:z-min, #:z-max, #:angle, #:altitude and #:z-label.
procedure
[ #:x-minx-min#:x-maxx-max#:y-miny-min#:y-maxy-max#:widthwidth#:heightheight#:titletitle#:x-labelx-label#:y-labely-label#:aspect-ratioaspect-ratio#:legend-anchorlegend-anchor#:out-fileout-file#:out-kindout-kind])
By default, plot produces a Racket value that is displayed as an image and can be manipulated like any other value. For example, they may be put in lists:
'([η»ε:image][η»ε:image])
When the parameter plot-new-window? is #t, plot opens a new window to display the plot and returns (void ).
When #:out-file is given, plot writes the plot to a file using plot-file as well as returning a snip% or opening a new window.
When given, the x-min, x-max, y-min and y-max arguments determine the bounds of the plot, but not the bounds of the renderers. For example,
When given, the aspect-ratio argument defines the aspect ratio of the plot area, see plot-aspect-ratio for more details.
Here, the renderer draws in [-1,1] × [-1,1], but the plot area is [-1.5,1.5] × [-1.5,1.5].
Deprecated keywords. The #:fgcolor and #:bgcolor keyword arguments are currently supported for backward compatibility, but may not be in the future. Please set the plot-foreground and plot-background parameters instead of using these keyword arguments. The #:lncolor keyword argument is also accepted for backward compatibility but deprecated. It does nothing.
Changed in version 7.9 of package plot-gui-lib: Added support for pictures for #:title, #:x-label and #:y-label. And to plot the legend outside the plot-area with #:legend-anchor
Changed in version 8.1 of package plot-gui-lib: Added #:aspect-ratio
procedure
[ #:x-minx-min#:x-maxx-max#:y-miny-min#:y-maxy-max#:z-minz-min#:z-maxz-max#:widthwidth#:heightheight#:angleangle#:altitudealtitude#:titletitle#:x-labelx-label#:y-labely-label#:z-labelz-label#:aspect-ratioaspect-ratio#:legend-anchorlegend-anchor#:out-fileout-file#:out-kindout-kind])
When the parameter plot-new-window? is #t, plot3d opens a new window to display the plot and returns (void ).
When #:out-file is given, plot3d writes the plot to a file using plot3d-file as well as returning a snip% or opening a new window.
When given, the x-min, x-max, y-min, y-max, z-min and z-max arguments determine the bounds of the plot, but not the bounds of the renderers.
When given, the aspect-ratio argument defines the aspect ratio of the plot area, see plot-aspect-ratio for more details.
Deprecated keywords. The #:fgcolor and #:bgcolor keyword arguments are currently supported for backward compatibility, but may not be in the future. Please set the plot-foreground and plot-background parameters instead of using these keyword arguments. The #:lncolor keyword argument is also accepted for backward compatibility but deprecated. It does nothing.
The #:az and #:alt keyword arguments are backward-compatible, deprecated aliases for #:angle and #:altitude, respectively.
Changed in version 7.9 of package plot-gui-lib: Added support for pictures for #:title, #:x-label and #:y-label. And to plot the legend outside the plot-area with #:legend-anchor
Changed in version 8.1 of package plot-gui-lib: Added #:aspect-ratio
procedure
( plot-snip <plot-argument>...)
<plot-argument>:<plot-argument-contract>
procedure
( plot3d-snip <plot-argument>...)
<plot-argument>:<plot-argument-contract>
procedure
( plot-frame <plot-argument>...)→(is-a?/c frame% )
<plot-argument>:<plot-argument-contract>
procedure
( plot3d-frame <plot-argument>...)→(is-a?/c frame% )
<plot-argument>:<plot-argument-contract>
Use plot-frame and plot3d-frame to create a frame% regardless of the value of plot-new-window? . The frame is initially hidden.
Use plot-snip and plot3d-snip to create an interactive snip% regardless of the value of plot-new-window? .
The snip% objects returned by plot-snip can be used to construct interactive plots. See Interactive Overlays for 2D plots for more details.
<plot-keyword>:<plot-keyword-contract>
procedure
output[ kind]<plot3d-keyword>:<plot3d-keyword-contract>
procedure
( plot-pict <plot-argument>...)→plot-pict?
<plot-argument>:<plot-argument-contract>
procedure
( plot3d-pict <plot3d-argument>...)→plot-pict?
<plot3d-argument>:<plot3d-argument-contract>
procedure
( plot-bitmap <plot-argument>...)
<plot-argument>:<plot-argument-contract>
procedure
( plot3d-bitmap <plot3d-argument>...)
<plot3d-argument>:<plot3d-argument-contract>
Use plot-file or plot3d-file to save a plot to a file. When creating a JPEG file, the parameter plot-jpeg-quality determines its quality. When creating a PostScript or PDF file, the parameter plot-ps/pdf-interactive? determines whether the user is given a dialog to set printing parameters. (See post-script-dc% and pdf-dc% .) When kind is 'auto, plot-file and plot3d-file try to determine from the file name extension the kind of file to write.
#:title"A 2D Parabola"
Use plot-bitmap or plot3d-bitmap to create a bitmap% .
procedure
dcxywidthheight#:<plot-keyword><plot-keyword>...)x:real?y:real?<plot-keyword>:<plot-keyword-contract>
procedure
dcxywidthheight#:<plot3d-keyword><plot3d-keyword>...)x:real?y:real?<plot3d-keyword>:<plot3d-keyword-contract>
Use these if you need to continually update a plot on a canvas% , or to create other plot -like functions with different backends.
When setting up an evaluator for a Scribble manual, require plot/pict instead of plot. Evaluation will produce picts instead of snips, which scale nicely in PDF-rendered documentation.
(requireracket/mathracket/matchracket/listracket/drawracket/classplot/pictplot/utils)))
If you use (require (for-label plot )), links in example code should resolve to documentation for the functions exported by plot.
When plotting in an environment where bitmap% instances can be shown but snip% instances cannot (for example, on a web page that evaluates Racket code), require plot/bitmap instead of plot.
<plot3d-argument>:<plot3d-argument-contract>