On this page:
Plot:   Graph Plotting
7.8

Plot: Graph Plotting

Neil Toronto <neil.toronto@gmail.com>

 (require plot) package: plot-gui-lib

The Plot library provides a flexible interface for producing nearly any kind of plot. It includes many common kinds of plots 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 interactive snips in DrRacket, as picts in slideshows, as PNG, PDF, PS and SVG files, or on any device context.

Plot is a Typed Racket library, but it can be used in untyped Racket programs with little to no performance loss. The old typed interface module plot/typed is still available for old Typed Racket programs. New Typed Racket programs should use plot.

For plotting without a GUI, see plot/no-gui. For plotting in REPL-like environments outside of DrRacket, including Scribble manuals, see plot/pict and plot/bitmap.

    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

      3.8 Interactive Overlays for 2D plots

    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 and Point Labels

      8.7 Vector Fields

      8.8 Error Bars

      8.9 Candlesticks

      8.10 Contours and Contour Intervals

      8.11 Contour Surfaces

      8.12 Rectangles

      8.13 Non-Border Axes

      8.14 Surfaces

    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 Legacy Typed Interface

    12 Compatibility Module

      12.1 Plotting

      12.2 Miscellaneous Functions