SED navigation bar go to SED home page go to Dataplot home page go to NIST home page SED Home Page SED Staff SED Projects SED Products and Publications Search Dataplot Pages

Dataplot Vol 1 Vol 2


Dataplot Reference Manual
Volume 1: Commands

Chapter 2: Graphics Commands Introduction

DATAPLOT supports a wide range of graphics commands. The PLOT command is the primary command for generating 2D graphs. It supports numerous formats and options and is both flexible and powerful. In addition, DATAPLOT provides a large number of specialized graphics formats. These can be broken down into the following categories.

X-Y Plots

    PLOT Generate a plot of variables and/or functions.
    ERROR BAR PLOT Generate a plot with error bars.
    IMAGE PLOT Render an image.
    VECTOR PLOT Generate a vector plot (pairs of points connected with arrows).

3-D Plots

Distributional Plots

Time Series Plots

Regression/Fitting Plots

Multivariate Plots

Design of Experiments/Analysis of Variance Plots

Statistics Plots

Reliability/Extreme Value Plots

Quality Control Plots

Interlaboratory Analysis/Proficiency Analysis Plots

Classification and Categorical Plots

The ... in some of the commands indicates user-defined options for the command, as in

    NORMAL PROBABILITY PLOT, UNIFORM PROBABILITY PLOT, etc.
    AUTOCORRELATION PLOT, CROSS-CORRELATION PLOT
    MEAN CONTROL CHART, RANGE CONTROL CHART, etc

DATAPLOT provides a great deal of flexibility in controlling the elements of a plot. For example, each plot trace can be drawn as a line, a character, a bar, or a spike. The settings for each of these is independent of the others. The chapter on Plot Control documents the commands for controlling the plot features.

The flexibility in controlling the plot attributes and features means that it is possible to create specialized chart formats not listed above. For example, various types of bar charts can be created from the standard PLOT command (and setting the LINE and BAR attributes appropriately). Check the various LINE, CHARACTER, BAR, and SPIKE attribute setting commands in the Plot Control chapter. It is also straightforward to change the default appearance of the supported charts with these attribute setting commands.

There are separate chapters that discuss topics such as available line styles and plot characters.

Multiple curves per plot

DATAPLOT can generate multiple curves per plot. For example,

    LINES SOLID BLANK
    CHARACTER BLANK O
    PLOT Y1 Y2 VS X
    PLOT Y1 VS X1 AND
    PLOT Y2 VS X2

The first plot command draws two curves (Y1 and Y2) against a common x coordinate while the second PLOT command plots two curves with different x coordinates. When drawing multiple curves, DATAPLOT uses the concept of “traces.” A trace is a connected set of points. Points in the same trace are plotted with the same attributes. In the above example, Y1 is trace 1 and Y2 is trace 2. This is used when setting the attributes for a curve. For example, Y1 is drawn as a solid line with no character while Y2 is drawn as an O with no connected line. The attribute setting commands (LINE, CHARACTER, LINE COLOR, LINE THICKNESS, etc.) specify the attributes for up to 100 traces. When a plot is generated, the first trace uses the first entry from each of the attribute setting commands, the second trace uses the second entries, and so on.

The ability to define traces is also useful in creating specialized chart formats. For example, it is easy to create a curve that is solid, then dashed for a certain number of points, and then solid again. This is done by creating a “tag” variable and then entering a command like PLOT Y X TAG. The variable TAG identifies those points in Y and X which are plotted with common attributes. The documentation for the PLOT command discusses the use of tag variables in more detail.

Overlaying plots

By default, DATAPLOT erases the screen at the beginning of a plot. The PRE-ERASE OFF command suppresses this initial screen erase and can be used to overlay plots on the same frame. If you do this, be sure to use the XLIMITS and YLIMITS command to set constant scales. The command LIMITS FREEZE (after the first plot) can be used if you do not know what your data limits are (this assumes the scales set for the first plot will contain the data for subsequent plots which may or may not be true). You may also want to suppress certain plot elements for subsequent plots (e.g., FRAME OFF, TIC MARKS OFF, TIC LABELS OFF) to avoid redrawing significant portions of a plot. However, this step is not required (it just saves plotting time).

Multiple plots per page

DATAPLOT provides three methods for positioning multiple plots on a page.

  1. The MULTIPLOT command allows you to specify an arbitrary number of rows and columns. It splits the page up into these rows and columns and each subsequent command that generates a plot simply moves to the next row and column position on the page. There is no restriction on the type of plot command that you can use. See the MULTIPLOT command in the Plot Control chapter for details.

  2. The WINDOW CORNER COORDINATES and the FRAME CORNER COORDINATES commands let you specify the portion of the page to use for the next plot. These can be used in conjunction with the PRE-ERASE OFF command to generate multiple plots per page.

    Using the WINDOW CORNER COORDINATES (or the FRAME CORNER COORDINATES) command is not as easy as using the MULTIPLOT command, but it is more flexible in that you can position the plot anywhere. This allows you to do some things that the MULTIPLOT command does not. For example, you can draw a small plot inside the frame of regular size plot.

  3. The EMBED command allows you to define subplot areas within a larger plot.

Plotting data subsets

DATAPLOT allows data subsets to be plotted by using the keywords SUBSET, EXCEPT or FOR. The SUBSET and EXCEPT keywords select subsets based on the values of one or more variables. The variable defining the subset need not be one of the variables being plotted. The FOR keyword selects subsets based on the row number (e.g., plot the first 10 rows or plot every fifth row).


Date created: 11/30/2023
Last updated: 11/30/2023

Please email comments on this WWW page to alan.heckert@nist.gov.