1. Home
  2. DOTPLOT procedure

DOTPLOT procedure

Produces a dot-plot using line-printer or high-resolution graphics (J. Ollerton & S.A. Harding).

Options

GRAPHICS = string token Whether to use high-resolution graphics or line-printer graphics (lineprinter, highresolution); default high
TITLE = text Title for the Dot Plot; default *
WINDOW = scalar Window number for the graph; default 1
SCREEN = string token Whether to clear the screen before plotting or to or continue plotting on the old screen (clear, keep); default clea
ENDACTION = string token Action to be taken after completing the plot (continue, pause); default * uses the current setting
DIRECTION = string token Order in which to sort the data before plotting, DIRECTION=* implies plot unsorted data (ascending, descending); default asce
LINES = string token How to draw guide lines on the plot, LINES=* omits the guide lines (todot, full); default todot draws lines from the x-origin to the dots

Parameters

YLABELS = texts Text specifying Y labels for each dotplot
X = variates Data to be plotted
PENDOTS = scalars Pen to draw the dots; default 1
PENLINES = scalars Pen to draw the lines; default 2

Description

DOTPLOT produces a dot-plot from two parameters, a variate of x-data and a text containing y-labels. Option GRAPHICS allows the plotting to be done using line-printer graphics instead of the default high-resolution graphics.

The display takes the form of a vertical histogram, with a single row for each value of YLABELS. The length of line for each row is specified by the corresponding value of x. It is customary to sort the data according to the x-values, into either ascending or descending order. This is controlled by the DIRECTION option, which by default is ascending; setting DIRECTION=* will plot the data unsorted.

For high-resolution plots the guide lines can also be drawn across the full width of the plot (LINES=full) or can be omitted (LINES=*). By default, pens are set up to draw the dots and lines in a form appropriate for the output device. For an interactive display, solid guide lines in pale grey are used; for other devices dashed or dotted lines are used. The plotting symbol is symbol 2 (circle), except for PostScript output which uses a solid dot (SYMBOL=-9). The parameters PENDOTS and PENLINES can be used to specify pens which have been set up with different attributes.

By default the dot-plot is produced in window 1, but this can be changed using the WINDOW option. A FRAME statement can be used before using DOTPLOT to change the size and position of the display (for example to widen the x lower margin to allow more space for the y-labels). The SCREEN option controls whether or not the screen is cleared before plotting and the ENDACTION option determines what action to take after completing the plot.

An XAXIS or YAXIS statement can be used to set axis titles, and modify the upper and lower bounds of the x-axis. If TITLE is unset and axis titles are not set explicitly, they will be generated from the identifier names of the YLABEL and X parameters.

For high-resolution plots, the default window size specifies a lower x-margin of size 0.12. This allows room for a title and labels of up to about 10 characters. To produce a dot-plot with longer labels, a FRAME statement should be used to specify new dimensions for the window that include a larger value for XMLOWER. A full-size window, with standard margins, has room for about 48 rows before the labels start to overlap. To produce a dot-plot with more rows the margins should be reduced or the axis pen size reduced.

Options: GRAPHICS, TITLE, WINDOW, SCREEN, ENDACTION, DIRECTION, LINES.

Parameters: YLABELS, X, PENDOTS, PENLINES.

Method

A y-variate is constructed with values 1…NVALUES(YLABELS) and plotted against the variate X. If required the variates are sorted (this action is performed on duplicates of the data so as not to alter the original variates).

Action with RESTRICT

DOTPLOT will obey restrictions on either YLABELS or X.

Reference

Cleveland, W.S. (1985). The Elements of Graphing Data. Wadsworth advanced books and software.

See also

Directive: DHISTOGRAM.

Procedures: BOXPLOT, DOTHISTOGRAM, RUGPLOT, STEM.

Commands for: Graphics.

Example

CAPTION 'DOTPLOT example',\
  !t('Data from Cleveland, W.S. (1985). The Elements of Graphing Data,',\
  'Wadsworth Advanced Books and Software. Page 115.');\ 
  STYLE=meta,plain
TEXT [NVALUES=22] Cities
VARIATE [NVALUES=22] Population
READ Cities,Population
Edinburgh 60  Constantinople 900  Palermo 130  Moscow 250  Turin 80
Amsterdam 220  Berlin 145  Stockholm 65  Dublin 210  Rome 160  Genoa 80
London 1100  Petersburgh 180  Madrid 140  Venice 200  Naples 380
Lisbon 120  Copenhagen 190  Warsaw 80  Vienna 255  Florence 75  Paris 690 :
DOTPLOT [TITLE='Populations (in thousands) of cities at end of the 1700s']\ 
        Cities; Population
Updated on March 8, 2019

Was this article helpful?