On this page:
Plot:   Graph Plotting
6.0

Plot: Graph Plotting

Neil Toronto <neil.toronto@gmail.com>

 (require plot) package: plot-gui-lib

Typed Racket users should use

 (require plot/typed) package: plot-gui-lib

Plot provides a flexible interface for producing nearly any kind of plot. It includes many common kinds already, such as scatter plots, line plots, contour plots, histograms, and 3D surfaces and isosurfaces. Thanks to Racket’s excellent multiple-backend drawing library, Plot can render plots as manipulatable images in DrRacket, as bitmaps in slideshows, as PNG, PDF, PS and SVG files, or on any device context.

For non-GUI uses, see plot/no-gui. For REPL-like environments outside of DrRacket (including Scribble manuals) in particular, see plot/pict and plot/bitmap.

A note on backward compatibility. Plot has undergone a major rewrite between versions 5.1.3 and 5.2. Many programs written using Plot 5.1.3 and earlier will still compile, run and generate plots. Some programs will not. Most programs use deprecated functions such as mix, line and surface. These functions still exist for backward compatibility, but are deprecated and may be removed in the future. If you have code written for Plot 5.1.3 or earlier, please see Porting From Plot <= 5.1.3 (and possibly Compatibility Module).

    1 Introduction

      1.1 Plotting 2D Graphs

      1.2 Terminology

      1.3 Plotting 3D Graphs

      1.4 Plotting Multiple 2D Renderers

      1.5 Renderer and Plot Bounds

      1.6 Plotting Multiple 3D Renderers

      1.7 Plotting to Files

      1.8 Colors and Styles

    2 2D and 3D Plotting Procedures

      2.1 GUI Plotting Procedures

      2.2 Non-GUI Plotting Procedures

      2.3 Pict-Plotting Work-a-Likes

      2.4 Bitmap-Plotting Work-a-Likes

    3 2D Renderers

      3.1 2D Renderer Function Arguments

      3.2 2D Point Renderers

      3.3 2D Line Renderers

      3.4 2D Interval Renderers

      3.5 2D Contour (Isoline) Renderers

      3.6 2D Rectangle Renderers

      3.7 2D Plot Decoration Renderers

    4 3D Renderers

      4.1 3D Renderer Function Arguments

      4.2 3D Point Renderers

      4.3 3D Line Renderers

      4.4 3D Surface Renderers

      4.5 3D Contour (Isoline) Renderers

      4.6 3D Isosurface Renderers

      4.7 3D Rectangle Renderers

    5 Nonrenderers

    6 Axis Transforms and Ticks

      6.1 Axis Transforms

      6.2 Axis Ticks

        6.2.1 Linear Ticks

        6.2.2 Log Ticks

        6.2.3 Date Ticks

        6.2.4 Time Ticks

        6.2.5 Currency Ticks

        6.2.6 Other Ticks

        6.2.7 Tick Combinators

        6.2.8 Tick Data Types and Contracts

      6.3 Invertible Functions

    7 Plot Utilities

      7.1 Formatting

      7.2 Sampling

      7.3 Plot Colors and Styles

      7.4 Plot-Specific Math

        7.4.1 Real Functions

        7.4.2 Vector Functions

        7.4.3 Intervals and Interval Functions

      7.5 Dates and Times

    8 Plot and Renderer Parameters

      8.1 Compatibility

      8.2 Output

      8.3 General Appearance

      8.4 Lines

      8.5 Intervals

      8.6 Points

      8.7 Vector Fields

      8.8 Error Bars

      8.9 Contours and Contour Intervals

      8.10 Rectangles

      8.11 Decorations

      8.12 3D General Appearance

      8.13 Surfaces

      8.14 Contour Surfaces

      8.15 Isosurfaces

    9 Plot Contracts

      9.1 Plot Element Contracts

      9.2 Appearance Argument Contracts

      9.3 Appearance Argument List Contracts

    10 Porting From Plot <= 5.1.3

      10.1 Replacing Deprecated Functions

      10.2 Ensuring That Plots Have Bounds

      10.3 Changing Keyword Arguments

      10.4 Fixing Broken Calls to points

      10.5 Replacing Uses of plot-extend

      10.6 Deprecated Functions

    11 Compatibility Module

      11.1 Plotting

      11.2 Miscellaneous Functions