PUBLICATIONS

^ ° F c

°. WW o

CO Q

NBS SPECIAL PUBLICATION 667

U.S. DEPARTMENT OF COMMERCE/National Bureau of Standards

DATAPLOT

Introduction

and

Overview

1934

C A
NATIONAL BUREAU OF STANDARDS

The National Bureau of Standards' was established by an act of Congress on March 3, 1901. The Bureau's overall goal is to strengthen and advance the Nation's science and technology

and facilitate their effective application for public benefit. To this end, the Bureau conducts

research and provides: (1) a basis for the Nation's physical measurement system, (2) scientific and technological services for industry and government, (3) a technical basis for equity in trade, and (4) technical services to promote public safety. The Bureau's technical work is per- formed by the National Measurement Laboratory, the National Engineering Laboratory, and

the Institute for Computer Sciences and Technology.

THE NATIONAL MEASUREMENT LABORATORY provides the national system of

physical and chemical and materials measurement; coordinates the system with measurement

systems of other nations and furnishes essential services leading to accurate and uniform

physical and chemical measurement throughout the Nation's scientific community, industry,

and commerce; conducts materials research leading to improved methods of measurement,

standards, and data on the properties of materials needed by industry, commerce, educational

institutions, and Government; provides advisory and research services to other Government

agencies; develops, produces, and distributes Standard Reference Materials; and provides

calibration services. The Laboratory consists of the following centers:

Absolute Physical Quantities 2 — Radiation Research — Chemical Physics —

Analytical Chemistry — Materials Science

THE NATIONAL ENGINEERING LABORATORY provides technology and technical ser- vices to the public and private sectors to address national needs and to solve national problems; conducts research in engineering and applied science in support of these efforts; builds and maintains competence in the necessary disciplines required to carry out this research and technical service; develops engineering data and measurement capabilities;

provides engineering measurement traceability services; develops test methods and proposes

engineering standards and code changes; develops and proposes new engineering practices;

and develops and improves mechanisms to transfer results of its research to the ultimate user. The Laboratory consists of the following centers:

Applied Mathematics — Electronics and Electrical Engineering2 — Manufacturing

Engineering — Building Technology — Fire Research — Chemical Engineering2

THE INSTITUTE FOR COMPUTER SCIENCES AND TECHNOLOGY conducts

research and provides scientific and technical services to aid Federal agencies in the selection, acquisition, application, and use of computer technology to improve effectiveness and

economy in Government operations in accordance with Public Law 89-306 (40 U.S.C. 759), relevant Executive Orders, and other directives; carries out this mission by managing the Federal Information Processing Standards Program, developing Federal ADP standards

guidelines, and managing Federal participation in ADP voluntary standardization activities; provides scientific and technological advisory services and assistance to Federal agencies; and

provides the technical foundation for computer-related policies of the Federal Government.

The Institute consists of the following centers:

Programming Science and Technology — Computer Systems Engineering.

'Headquarters and Laboratories at Gaithersburg, MD, unless otherwise noted; mailing address Washington, DC 20234.

2 Some divisions within the center are located at Boulder, CO 80303.
C I r C

DATAPLOT — Introduction and Overview

James J. Filliben

Center for Applied Mathematics

National Engineering Laboratory

National Bureau of Standards

Washington, DC 20234

c> *

Q

U.S. DEPARTMENT OF COMMERCE, Malcolm Baldrige, Secretary

NATIONAL BUREAU OF STANDARDS, Ernest Ambler, Director

Issued June 1984
Library of Congress Catalog Card Number: 83-600598

National Bureau of Standards Special Publication 667

Natl. Bur. Stand. (U.S.), Spec. Publ. 667, 112 pages (June 1984)

CODEN: XNBSAV

U.S. GOVERNMENT PRINTING OFFICE

WASHINGTON: 1984

For sale by the Superintendent of Documents, U.S. Government Printing Office, Washington, DC 20402
iii

Preface

The DATAPLOT language was designed and developed

in 1976 in response to data analysis problems

encountered in the scientific/research environment

at the National Bureau of Standards . At such time

it became increasingly evident that the 3 highest

priority computing activities of the

scientist/engineer were

1. graphics (especially continuous);

2. fitting (especially non-linear

; 3. operations with functions

Up to that time, the generation of such continuous

graphics, the carrying out of such non-linear

fits, and the application of such function

operations was typically done in a subroutine-dependent, batch-oriented fashion which

was time-consuming and non-conducive to the

continuity of thought which is so important in

scientific investigations . The need was seen, therefore , for the development of a

high-level

English- syntax,

interactive

language which inducted single-command capabilities for

continuous graphics

non-linear fitting;

function evaluation/ transformations

The realization of this goal occurred in early

1977 with the NBS implementation of the DATAPLOT

language with its 3 kernel commands—

PLOT (for graphics);

FIT (for fitting);

LET (for function operations ) . These 3 commands were from the beginning the core

of the DATAPLOT language and their central role as such has become a distinctive mark of the

1 an gua ge

In addition to the above core activities , however,

the language has extensive capabilities in

1) graphics (continuous or discrete);

2) fitting (non-linear or linear);

3) general data analysis;

4) mathematics.

DATAPLOT commands are high-level , English-syntax, and

self-descriptive , such as

PLOT Y X PLOT EXP(-X**2) FOR X = -3 .1 3 FIT Y = A+B*EXP(-ALPHA*X)

BOX PLOT Y X ANOVA Y XI X2 X3 LET FUNCTION F = DERIVATIVE EXP( -X**2 ) / ( A ;B*X ) WRT X

Although DATAPLOT may be used in a batch

environment, the language was designed for

(and is most effectively used in) an interactive environment . DATAPLOT has proven to be a valuable time-saving tool (from the

early stages of an analysis through to the

final presentation graphics ) for the scientist

engineer, data analyst, and general researcher

alike. No programming experience is assumed in

using DATAPLOT; it is used by both the novice

programmer and by the veteran analyst.

This book should serve as a comprehensive

reference for all DATAPLOT programmers . It is

the author's intention that the layout of this

book will

o facilitate the learning of the DATAPLOT

language

o encourage the use of the many features

of the language;

o result in more thorough and insightful

analyses ; and

o result in significant savings of the

analyst 's time.

Indeed, the use of the DATAPLOT language as

a computing tool in solving the variety of

problems which arise daily in a research

environment will allow the scientist to "think

science" as opposed to "think computing"

The National Technical Information Service (NTIS)

has been distributing the NBS-DATAPLOT tape

since March of 1982. There have been 3 major

releases—

March 1982—ANSI FORTRAN 66, General Version

July 1982—ANSI FORTRAN 77, General Version June 1983—ANSI FORTRAN 77, Vax-Specific Version

The language defined in this book is consistent

with the source code released from NBS to NTIS for

distribution as of September 1983. Prior versions

may differ slightly from specifications outlined

in this manual. In particular , the LOOP command,

the IF command, the VALU( ) sub-command , the bar

plot patterns/spacing , and the symbolic

differentiation do not apply for earlier versions

The NBS source code tape which NTIS distributes is

portable—out of the 600 ANSI FORTRAN subroutines

(= 200,000 lines of FORTRAN code), only a few (less than 10) of the subroutines need be

changed in going from one computer to the next. Known implementations exist on Univac,

Vax, Honeywell, and Prime computers; other

implementations are in progress . For distribution

information, contact
i V

National Technical Information Service

United States Department of Commerce

Springfield , Virginia 22161

703-487-4805

This book has had the benefit of constructive and

insightful comments from a number of different

individuals—both inside and outside of NBS. Particular thanks are extended to my NBS

colleagues Stefan Leigh and Roland DeWit whose

excellent reviewing and editing served to substantially improve earlier versions of this

manual. Additionally, the comments of my

colleagues in the Center for Applied Mathematics

at NBS have been extremely valuable in regard to both this manual and the DATAPLOT language. In spite of the above, however, there no doubt still

remain discrepancies , errors, omissions, and

other technical ambiguities in this manual. In such case, the author welcomes the opportunity

of receiving feedback from readers, and will

be glad to make corrections and

clarifications . Please direct such questions and

comments to

James J. Filliben

Statistical Engineering Division

Center for Applied Mathematics

Administration Building , Room A-337

National Bureau of Standards

Washington , D. C. 20234

301-921-3651

James J. Filliben

May 1984
V

Disclaimer

The purpose of the manual is to give the analyst

a broad overview of the structure , capabilities

,

and features of the DATAPLOT language

.

Certain commercial brand names (e.g., Tektronix,

Calcomp, Texas Instruments, etc.) are mentioned in

this document. This does not constitute an endorsement of such products by either the

author or the United States Government.

The features and capabilities described in this

primer are for version 84/7 of DATAPLOT . Most

(but not all) descriptions also hold for prior

versions

.

Neither the author nor any branch of the United

States Government may be held liable for errors

arising from the use of the DATAPLOT language or

the implemented DATAPLOT system.

Suggestions and comments are welcome. Please

forward them to

James J. Filliben

National Bureau of Standards

Administration Building, Room A-340

Washington, D.C. 20234

301-921-3651
vi

Changes from Previous Versions

The National Technical Information Service (NTIS)

has distributed 3 prior versions of DATAPLOT—

Version 82/3

Version 82/7

Version 83/5

FORTRAN 66 (General)

FORTRAN 77 (General)

FORTRAN 77 ( Vax

)

Version 84/7 will be released from NTIS shortly

( July 1984 ), and will be primarily

distinguished from earlier versions in that it

will have the benefit of code updates (for certain

uncovered bugs) and capability enhancements (for

added analysis power).

The features and capabilities described in this

manual are for version 84/7 of DATAPLOT. Most

(but not all) descriptions also hold for the

prior released versions (82/3 and 82/7).

Commands available in 84/7

versions include--

but not in earlier

The analytic differentiation sub-capability under

the LET FUNCTION command has been reinstated for

version 84/7, but was omitted from earlier

versions

.

New data analysis capabilities

added to the 84/7 version are

which have been

1) The BOX PLOT command has been

generalized (via the FENCE command)

so that values beyond the inner and outer

fences may be indicated

.

2) Robust (3RSR) smoothing and Hamming

smoothing have been added.

3) Stem and Leaf diagrams have been added.

4) The CONTROL CHART command has been

generalized to cover the unequal-sample

size case.

READ PARAMETER

READ FUNCTION

for reading parameters

from a file;

for reading functions

from a file;

James J. Filliben

May 1984

LOOP

IF

for looping;

for conditional execution

of a block of statements

;

LIST for listing a subprogram

on a file.

The MACRO ON, MACRO OFF, and MACRO EXECUTE

commands of previous versions are described in

this manual as the CREATE ON, CREATE OFF, and CALL

commands . The MACRO commands will still work in

84/7 , but the preferable commands are CREATE and

CALL.

The ANGLE UNITS command of previous versions is

described in this manual as the TRIG UNITS

command—either will work in 84/7 .

The COMMENT command in previous versions (to write

out descriptive text) is described in this manual

as a sub-capability under the WRITE command, so

that

COMMENT CALIBRATION ANALYSIS

and

WRITE "CALIBRATION ANALYSIS"

both have the same effect in 83/10.
Vll

Table of Contents

General

What is DATAPLOT? 1-1

Capabilities 1-1

Getting Into and Out of DATAPLOT 1-2

Getting Started with DATAPLOT 1-3

4 Typical Problems 1-5

4 DATAPLOT Solutions 1-7

Programming with DATAPLOT 1-11

English-Syntax Language 1-12

Free- Format Language 1-12

Declaration-Free Language 1-13

Structured Language 1-13

Punctuation 1-14

Language Components 1-14

Command Categories

Commands 2-1

Graphics Commands 2-2

Analysis Commands 2-3

Diagrammatic Graphics Commands 2-4

Plot Control Commands 2-5

Support Commands 2-6

Output Device Commands 2-18

Keywords 2—9
viii

Parameters, Variables, and Functions

Arithmetic Operations 3-1

Relational Operations 3-1

Numbers 3-2

Parameters 3-3 LET

Variables 3-4

LET, READ, and SERIAL READ

Functions 3-5 LET FUNCTION

Evaluating Functions 3-5

LET

Sub-commands Under the LET Command 3-6

Statistics, Mathematics, Random Numbers, Manipulation

LET

Built-in Library Functions 3-12

LET, LET FUNCTION, PLOT, 3D-PLOT, FIT, and PRE-FIT

Creating Parameters , Variables , and Functions 3-15

LET, LET FUNCTION, READ, and SERIAL READ

Copying Parameters , Variables , and Functions 3-15

LET

Deleting Parameters , Variables , and Functions 3-16

DELETE

Assigning Multiple Names to a Variable 3-18

NAME

Creating Data Internally

LET, READ, and SERIALLY READ

3-19
ix

Input/Output

Files and Subfiles 4-1

Input/Output 4-3

Reading in Columns of Data 4-4

READ

Reading Data in Sequentially 4-7

SERIAL READ

Reading in Parameters 4-8

READ PARAMETER

Reading in Functions 4-9

READ FUNCTION

Writing Out Parameters , Variables , and Functions 4-10

WRITE

Skipping Over Lines in a Read 4-11

SKIP

Restricting a Read to Certain Rows 4-11

ROW LIMITS

Restricting a Read to Certain Columns 4-12

COLUMN LIMITS

Terminating a Read 4-12

END OF DATA

LOOP

Conditional Statements

SUBSET, EXCEPT, FOR, and IF

Calling Subprograms

CALL

Creating Subprograms

CREATE

Listing Subprograms

LIST

Program Control

Looping 5-1
X

Mi see 1 1 aneous

Restricting Plots and Analyses to Subsets

SUBSET, EXCEPT, and FOR

In-line Text Sub-commands

TITLE, ...LABEL, LEGEND, and TEXT

Defaults, Restrictions, and Settings

Dumping Status Information

STATUS

Dumping On-Line Documentation

HELP

Redimensioning Internal Storage

DIMENSION

Specifying the Terminal

TERMINAL

Specifying the Host HOST

Specifying the

COMMUNICATIONS

Specifying Trigonometric Units

TRIGONOMETRIC UNITS

Echoing Commands

ECHO

Suppressing Printed Output

FEEDBACK and PRINTING

6-15

6-17

6-18

6-18

6-20

6-21

6-22

Communications Link 6-19 LINK and BAUD RATE

Diverting Graphics Output to Offline Devices 6-23

PENPLOTTER, ZETA, CALCOMP , and VERSATEC

Redefining I/O Units and Saving DATAPLOT Output 6-25

SET

Controlling The Terminal —Erasing, Hardcopying , etc. 6-26

PRE-ERASE, HARDCOPY, ERASE, and COPY

Activating Local Settings

IMPLEMENT

6-28
xi

Entering Comment Lines

COMMENT and .

Recommended Programming Practices

Interrupting , Saving, and Resuming A Run

SAVE and RESTORE

Starting Over

RESET

Communicating with the Host Operator

OPERATOR

Communicating with DATAPLOT Service Group

MESSAGE, NEWS, MAIL, and BUGS

DATAPLOT File Information for Implementation

Default Output Device Settings

Color Graphics

TERMINAL, COLOR, and PICTURE POINTS

Multiple Commands Per Line

TERMINATOR CHARACTOR

Specifying Post-Plot Cursor Position and Size

CURSOR SIZE
i
1-1

What is DATAPLOT? Capab i 1 i t ies

DATAPLOT is an interactive high-level ( free-format

English-like syntax) language with extensive

capabilities in

1) Graphics (continuous or discrete);

2) Fitting (non-linear or linear);

3) General Data Analysis

;

4) Mathematics

.

DATAPLOT was developed originally in 1977 in

response to data analysis problems encountered at

the National Bureau of Standards . DATAPLOT may be

run either in batch mode or interactively

,

although it was primarily designed for (and is most effectively used in) an interactive

environment . DATAPLOT graphics may appear on many

different types of output devices.

DATAPLOT has a broad scope of capabilities—

1) raw graphics (2-D, 3-D, color, single/

multiple plots per page, etc.);

2) analysis graphics (plotting data, plotting

functions )

;

3) presentation graphics (special fonts,

Greek, math symbols, word charts, etc.);

4) diagrammatic graphics (diagrams

,

schematics, etc.);

5) graphical data analysis (box plots, probability plots, histograms , control charts,

lag plots, EDA, residual analysis, etc.);

6) time series plots (autocorrelation plots,

spectral plots, demodulation plots, etc.);

7) fitting (non-linear, multi-linear, polynomial, spline, etc.);

8) general data analysis (ANOVA, median

polish, robust smoothing, ANOP , etc.);

9) statistical/probability capabilities (. 20

statistics , cdf's, ppf's, random numbers,

etc. );

10} mathematics (roots, differentiation,

integration, convolution, etc.);

11) subset analyses (as easy as full-set

analyses )

;

12) extensive built-in Fortran-like library

of math and probability functions

.

»
1-2

Getting Into and

Out of DATAPLOT

The procedure for accessing DATAPLOT varies from

one computer to the next. For example, on a Univac computer, one enters

@DATAPLOT

On a Vax computer, one enters

DATAPLOT

Check with the local DATAPLOT service group to determine the local convention for accessing

DATAPLOT. Upon entry into DATAPLOT, the DATAPLOT

banner will appear, along with a version number,

and dimension message about the current

configuration , as in—

****************************************************

* DATAPLOT *

* INTERACTIVE GRAPHICAL DATA ANALYSIS LANGUAGE * ****************************************************

VERSION 83/1

INTERNAL DATA STORAGE CAPACITY = 10,000 OBSERVATIONS

(1000 OBSERVATIONS PER VARIABLE X 10 VARIABLES)

To exit from a DATAPLOT program, one enters any of

the following—

EXIT

END

STOP

HALT

BYE
Getting Started with DATAPLOT

Suppose the analyst has the following

observations on the variables X and Y—

X Y

I 1 2 3 3 15

4 18

5 30

Enter a DATAPLOT program to carry out the

following 4 operations —

1) Compute the mean of the Y data;

2) Plot Y versus X with titles and labels;

3) Carry out a least squares fit of Y on X with a linear model;

4) Generate a plot with the fitted values

from the linear fit on top of the raw data.

To do so, one first invokes DATAPLOT (e.g., by

entering @DATAPLOT on UNIVAC computers, and

whatever is appropriate on other computers ) . Upon

invoking DATAPLOT, a DATAPLOT banner and a few

lines of messages will appear on the screen.

One is now ready to enter the DATAPLOT program. A program to carry out the above 4 operations is as follows —

. STEP 0 —READ IN THE DATA

READ X Y

1 1 2 3

3 15

4 18

5 30 END OF DATA

. STEP 1 —COMPUTE THE MEAN

LET M = MEAN Y

. STEP 2—PLOT THE DATA

TITLE CALIBRATION ANALYSIS

YLABEL RESPONSE

XLABEL FORCE

PLOT Y X

. STEP 3 —FIT THE DATA

FIT Y=A+B*X

. STEP 4—GENERATE A SUPERIMPOSED PLOT AFTER THE

CHARACTERS X BLANK

P LINES BLANK SOLID

PLOT Y PRED VERSUS X

EXIT

All lines beginning with . (period) are non-executing comment lines and so DATAPLOT will

ignore them; they are included here for clarity.

There are 15 such lines in the above program.

Ignore them or enter them at your discretion. The

existence of such comment lines is more common in

a DATAPLOT program to be stored in a file (and run later in toto ) than in a DATAPLOT program to be entered line by line and run interactively

The READ statement will read data into variables X

and Y. the read is format- free and so spacing

between data values on a line is unimportant (but

at least one space between data values must

exist —3 15 could not be writted as 315). Since

there are only 5 data pairs, they are entered

directly from the terminal (as opposed to reading

the data from a file). The read terminates when

an END of DATA line is entered.

LET M = MEAN Y computes the mean of the data in

the variable Y, prints out the value, and stores

this value in the internal DATAPLOT parameter M. DATAPLOT has over 20 summary statistics (MEAN,

MEDIAN, STANDARD DEVIATION, CORRELATION, etc.)

which may be similarly invoked via the LET

command.

TITLE CALIBRATION ANALYSIS defines the title to appear above subsequent plots; YLABEL RESPONSE

defines the vertical axis label to appear on subsequent plots; XLABEL FORCE defines the

horizontal axis label to appear on subsequent

plots. PLOT Y X actually generates the plot —Y will be plotted vertically and X horizontally . The

plot will have a solid line (the default)

connecting the data points. The pre-defined

titles and labels will be automatically written

out on the plot. The plot limits will be

automatic and neat.

FIT Y = A+B*X+C*X**2 carries out a least squares

linear fit of Y on X. The coefficients and

other results from the fit are be printed out. Predicted (= fitted) values from the fit are automatically placed in a variable PRED, and

residuals from the fit are automatically placed in

the var iable RES. The above model ( linear ) is

simple—DATAPLOT may carry out least squares fits

for not only such polynomial and multi-linear

models, but also for general non-linear models.

CHARACTERS X BLANK specifies that the first trace

on subsequent plots should have X's as the plot

character and the second trace should have blank

(= no) plot character. LINES BLANK SOLID

specifies that the first trace on subsequent plots

should have a blank (= no) connecting line, and

the second trace should have a solid connecting

line. PLOT Y PRED VERSUS X generates the

superimposed plot of the raw data Y and predicted

values PRED as a function of X. Due to the prior

CHARACTERS and LINES commands, the first trace (Y versus X) has X's as characters and no connecting

line ; the second trace (PRED VERSUS X) has no

plot characters but solid connecting lines.

EXIT terminates the DATAPLOT run.
1-4

The output from the above DATAPLOT program is as follows —

THE MEAN OF THE 5 OBSERVATIONS

THE COMPUTED VALUE OF THE PARAMETER M

. 1 3486800+382

.13489088+002

If the analyst were running on an alphanumeric

terminal (e.g., Texas Instrument Silent 700) then

the code should be preceded by a DISCRETE command

which instructs DATAPLOT that the terminal is

essentially non-continuous (has no ability to draw a continuous straight line from any point on the screen to any other point on the screen] and

therefore the plots should be suitably modified.

Also, the BLANK in

CHARACTERS X BLANK

I I I I

CALIBRATION ANALYSIS

2 3 A S -fl I I I [

I I I I |

I I I 1 j-30

LEAST SQUARES NON-LINEAR FIT

SAMPLE SIZE N = S MODEL —Y=A+B*X

NO REPLICATION CASE ITERATION NUMBER CONVERGENCE

MEASURE

I —

2— . 10088-001

. 50000-002

RESIDUAL * STANDARD * DEVIATION **-

1 7000+002 * 38714+001 *

PARAMETER

ESTIMATES

. 10808+881 .84844+881

. 10888+081 .729S1+00I FINAL PARAMETER ESTIMATES

1 A -8.50881

2 B 7.30800 RESIDUAL

RESIDUAL

STANDARD DEVIATION DEGREES OF FREEDOM

(APPROX. ST. DEV. )

1 3.221 )

( .9713 ) 3.0713732S41

3

should be replaced by some non-blank character, as iCHARACTERS X P

The 2 plots will thus appear as —

CALIBRATION ANALYSIS

. r 1 J.

. 3300000 +002

. 28S5000+002

.2710000+002

. 2565000+002

.2420000+002 .2275000+002

.21 30000+002

. 1 985000+002

. 1840000+002

. 1695000+002

. 1550000+002

. 1 40S080+002

. 1260000+002

.111 5000+002

.9700000+001

.8250080+001 .6800000+001

.5350003+001

. 3900000+001

.2450080+001

. 1000000+001

-I- 1000+001 .2000+001

! 1 1 .3088+081 .4088+081 .5888+08 FORCE

CALIBRATION ANALYSIS

2 3 4

.3800088+002

.2844000+002

. 2688000+002

.2S32000+002

.2376000+002

.2220800+002

. 2064000+002

. 1908000+002

. 1 752000+002

. 1 596000+002

. 1 440000+002

. 1284000+002

. 1 128800+002

.9719998+001

.8159997+001

.6599997+001 .5039997+001

.34 79997+001

. 1919997+801

. 3599966+080

-. 1200004+001

CALIBRATION ANALYSIS

.! j ! 1

I 1 —

.1000+001 .2088+801

j j j .3080+001 .4080+081 .5008+081 FORCE
l-.c

4 Typical Problems

A computer language is a tool —a means of

generating solutions to problems. Before delving

into the details of the DATAPLOT language, let us first consider the types of problems that the

scientist/engineer/ research scientist typical ly

encounters. This will provide motivation for how

the computer language ( as a tool) was developed.

All computer languages have their own areas of

strength . The choice of problems below serve as a frame of reference for both reader and developer

alike as to the type of problems that DATAPLOT

considers "important* and for which it has been

designed to be strong in.

1) A Graphics Problem—

An analyst has a data set consisting of

(x,y) pairs. Plot the data. "Blow up"

any intersting sub-regions of the plot.

2) A Non-Linear Fitting Problem—

An analyst has a data set consisting of

(x,y) pairs. Read the data into the

computer. Plot them. Carry out a non- linear fit for the model

y = exp( -alpha'x ) / ( a+b*x

)

Generate a superimposed plot of raw data and predicted values from the

fit. Generate a plot of residuals

versus x. Generate a normal probability

plot of the residuals .

3) A Data Analysis Problem—

An analyst has data consisting of a response variable and 3 independent

variables (factors). Determine if the

factors affect the response . Determine

if there is interaction between the

factors. Carry out an analysis of

variance . Carry out a graphical

analysis of variance

4) A Mathematics Problem—

An analyst wishes to examine the

function x*exp(-x) + sin(x**2) over the

interval 0 to 3. Plot the function

over the interval . Determine any

roots in the interval . Determine

its definite integral over the interval

Several points are noteworthy—

1) Graphics as a Core Activity.

Note the graphics component that

exists in all of the above problems—

graphics is a key activity in

both data analysis and mathematics.

2) Time.

These problems should all be solvable

with less than 10 lines of code.

3) Number of Lines of Code.

These problems should all take less

than 10 minutes to solve.

4) Interactive Analysis.

These problems should be solvable

interactively so that in case some interesting tangent arises in the course of the solution, the analyst may

immediately pursue it.

5) Graphics Quality.

Ideally, the graphics should be all

continuous and of manuscript-quality if

so desired.

6) Variety of Graphics Devices.

On the other hand, if the analyst is

working at a discrete terminal or in

batch, neither the logic of the analysis nor the entered plot commands should be

any different

7) Subset Analyses.

The analyst should not need to worry

about whether the graphics, fitting, or data analysis is being carried out over

the full data set or over any

complicated subsets of the data.

Carrying out analyses over subsets

should not result in irrelevant (as far

as the scientist is concerned)

preliminary data extraction and

manipulation. It should be as easy to carry out any (and all) graphics and

analysis operations over a subset as it

is to carry it out over the full set.

8) Sample Size.

The analyst should not need to worry

about whether the data set consists of 7 data points or 700 data points—the

number of data points is a nuisance

parameter that the analyst should not need

to concern himself with.

9) Data Format.

The analyst should not need to worry

about how the data is formatted upon input—this also is an unimporant

nuisance item.
10) Predicted Values and Residuals

.

The analyst should not need to worry

about predicted values and residuals

from the fit —they should be

automatically available for further

analysis and plotting

.

11) Scope of Capabilities

.

The analyst should be able to fluidly glide from graphics to fitting

to data analysis to mathematics

activities with no interruption and

within the context of the language.

12) Ease of Use. The ultimate objective of the

analyst is not in learning a computer

language—it is in gaining insight into

the problem at hand; thus the computer

language should be natural , easy to learn, and easy to use. The language

that the analyst uses should preserve

the continuity of thought that is so important in scientific research.

13) English-Syntax.

Ideally, the language should correspond

as close as possible to the Englishlanguage and mathematical representation

of the solution. This will allow

the analyst to "think science" as opposed to "think computing" and

will eliminate an unnecessary mapping

from conceptual solution to computerlanguage solution.
1-7

4 DATAPLOT Solutions

1. The Graphics Problem—

An analyst has a data set consisting of

(x,y) pairs. Plot the data. "Blow up"

any intersting sub-regions of the plot.

The DATAPLOT program and output is as followsREAD FILE1 . X Y PLOT Y X

PLOT Y X SUBSET X 400 TO 600

1000

0. 370

-0.372

0. 374

-0. 3/6

-0.378

-0. 380

-0. 370

-0. 372

1.374

-0.376

-e.378

-0.380

200 400 600 800 1000

400 450 500

-0-370 j—|

1—[

|—4—t—i—1—I—|—

). 372-

-0.374 —

).376

-0.378-

•0. 380

550 600 —I—I

1—I—I—1- "0. 370

u u u y

i i i i

I 459

-0.372

- -0. 374

-0.376

-0.378

-0.380 500 550 600
1-8

2. The Non-Linear Fitting Problem—

An analyst has a data set consisting of

(x,y) pairs. Read the data into the

computer. Plot them. Carry out a non- linear fit for the model

y = exp(' -alpha*x ) / ( a+b*x

)

Generate a superimposed plot of raw data and predicted values from the

fit. Generate a plot of residuals

versus x. Generate a normal probability

plot of the residuals

.

The DATAPLOT program and output is as follows—

2 3 4 5 s

READ FILE2.

PLOT Y X

X Y

I I I I I I I I I I I I I I I I I I I I I I

H4

I

I

I I M I

I [ I I

I

I I i I

I

I I I I

I

I I I I

20

LET A=0

LET B = 1 LET ALPHA=.l

FIT Y = EXP ( -ALPHA *X ) / ( A+B*X

)

CHARACTERS X BLANK

LINES BLANK SOLID

PLOT Y PRED VERSUS X PLOT RES X NORMAL PROBABILITY PLOT RES

l aa 4-H M I

I I I I

I

I I I I

I

I I I I

I

I I I I II I I I 1 l

0 I 2 3 4 5 e M I I I M I I

I

I I I I

I

I M I

I M I I

I

I I I I I 28

20-

I I I

| I I I I| I I I I

| I I I I

|

I I I I

| I I I I I B

x

^xx x

x *xx

x

X X m\ nil f>i

^

X x

I I M |

I I I I

|

I M | |

| | | |

|

| [ | | || | | | -28

;r SOUAPES NONLINEAR FIT 5«'Lt Sl/F N - 214

"OiX.l -Y-t/Pi -ALPHA»X >/< A*B»X

I

'•I 1>1 I CAT ION CASE m plication standard deviation

W.PLICAT10N DEGREES OF FREEDOM NjMBER Oi DISTINCT SUBSETS

.3281 762680+88 I 102

22

ITIRAT.'ON CONVERGENCE

NUMBtR MEASURE

RES 1 DJAL * PARAMETER

STANDARD * ESTIMATES

DEVIATION *

3-

4

- S--

. leeae-aei .58800-002

.25088-082

. 12500 -082 .62500-003

.42568*002

.13287*002

.42340*001

.33646*001

.33617*001

19888+388

13103+888

.16576*800 18896*080

10852+888

.28057-882 .46103-882

.68624-902 .61357-082

f-INAL PARAMETER ESTIMATES (APPROX. ST. DEV. )

1 ALPHA .108403 ( .2288-881)

2 A .613287-882 ( .3402-003)

3 B .185268-081 ( .8827-883) RESIDUAL STANDARD DEVIATION « RESIDUAL DEGREES OF FREEDOM REPLICATION STANDARD DEVIATION - REPLICATION DEGREES OF FREEDOM » LAC< Of- KIT F RATIO = 1.5474

F DISTRIBUTION WITH 10 AND

. 18888-881

.12365-881

. 11 885-88

1

. 18578-801

, 18521-081

THE

3.3616723128

211 3.2817626804

102

02. 6461 X POINT OF THE

3-2-1 0 1 2 3 H I I

|

I I I I

1

I I I I |I I I I

|

I I I I

|

I I I I I 20

102 DEGREES OF FREEDOM

XXX

- 2B

I

I I I I

1 M I I

| I I I I j

| | | |

|

| | | |

| -3-2-10 | | | |

| 2 3
1-9

3. The Data Analysis Problem—

An analyst has data consisting of a response variable and 3 independent

variables (factors ) . Determine if the

factors affect the response . Determine

if there is interaction between the

factors. Carry out an analysis of

variance . Carry out a graphical

analysis of variance

The DATAPLOT program and output is as follows—

READ FILE3 . Y XI X2 X3

ANOVA Y XI X2 X3

LET TAG = X2+2*(X3-1)

CHARACTERS 112 2 LINES SOLID DOTTED SOLID DOTTED

PLOT Y XI TAG

********************************** **********************************

** 3-WAY ANALYSIS OF VARIANCE «* *«•****«»»*»*»*»**« »** ****«»** *********************************

-2.000 -1.200

I I I 1 I I

-0.400 0.400 1.200

I I I I I I 1 I

NUMBER OF OBSERVATIONS

NUMBER OF FACTORS

NUMBER OF LEVELS FOR FACTOR 1 NUMBER OF LEVELS FOR FACTOR 2 NUMBER OF LEVELS FOR FACTOR 3 RESIDUAL STANDARD DEVIATION

RESIDUAL DEGREES OF FREEDOM

NC REPLICATION CASE NUMBER OF DISTINCT CELLS ****************

* ESTIMATION * *««*«**«*****««*

B

32

2

2 .65348454 1 02'002

4

300

GRAND MEAN . 1 8487588808*003

GRAND STANDARD DEVIATION .90256431588*082

LEVEL -ID Nl MEAN EFFECT StXEFFEC

(ACTOR 1 — -i .00000 4. 107.75080 -77. 12588 23. 10134

i .00000 4. 262.00388 77. 12588 23.18134

FACTOR 2 — - 1 . 00008 4. 160.25080 -15.62580 23. 10134

1 .00060 4. 200.50980 15.62589 23. 10134 FACTOR 3— - 1 . 00000 4. 167.75000 -17. I2S08 23. 10134

i . 00000 4. 202.00880 17. I2S88 23. 18134 •1.200 -0.400 0.400 I .200 2.000

MODEL RESIDUAL STANDARD DEVIATION

C0NSTANT CONSTANT

CONSTANT CONSTANT

CONSTANT

ONLYFACTOR I ONLYFACTOR 2 ONLYFACTOR 3 ONLYALL 3 FACTORS --

80. 25643 15796 50.6801258618

105.6801385880

105.3697853088 65.3484541016

*************

* TESTING * *************

NUM. LEVELS F STAT. F CDF

FACTOR I-- 2 11.14502280925 07.1131

FACTOR 2— 2 .45747328177 46.4I0X

FACTOR 3— 2 .54052422520 50.8331

RESIDUAL STANDARD DEVIATION - 65.34045410156

RESIDUAL DEGREES OF FREEDOM = 4
1-10

4. The Mathematics Problem—

An analyst wishes to examine the

function x*exp(-x) + sin(x**2) over the

interval 0 to 3. Plot the function

over the interval. Determine any

roots in the interval. Determine

its definite integral over the interval.

The DATAPLOT program and output is as follows—

LET FUNCTION F = X*EXP( -X ) +SIN ( X* * 2

)

PLOT F FOR X = 0 .1 3 LET R = ROOTS F WRT X FOR X = 0 TO 3 LET INT = INTEGRAL F WRT X FOR X = 0 TO 3

1.5 2.0 2.5 3.0

1.0- Mi ll ++

IN rr. ORAL EVALUATION

L"1>NCT;0N--(X*EXP< -X)+SIN(X**2> > SPECIFIED LOWER LIMIT OF INTEGRAL * SPECIFIED UPPER LIMIT OF INTEGRAL = NUMBER OF VARIABLES OF INTEGRATION « 3.0000000000

1 NUMBER OF PARTI riONS VALUE OF INTEGRAL

1574414+001

1574414+001

INTEGRAL VALUE = .1574414+001

THE COMPUTED VALUE OF THE CONSTANT INT . 1574414*001

-0.5

-1 .0 0.0 0.5 1.0 1.5 2.5 3.1

ROOTS CF AN EQUATION

FUNC I0N--C X*EXP( -XJ+SINI X**2) i ROOT VARIABLE SPECrFIED LOWER LIMIT OF INTERVAL SPECIFIED UPPER LIMIT OF INTERVAL NUMBER OF ROOTS FOUND IN INTERVAL

ROOT

ROOT

ROOT

1 = 2 = 3 =.0000000

. 18S3707+001 .2464136+001

.0000000000 3.0000000000

THE NUMBER OF VALUES GENERATED FOR THE VARIABLE R

THE FIRST

THE LAST ( 3TH) COMPUTED VALUE OF R COMPUTED VALUE OF R

THE CURRENT COLUMN FOR THE VARIABLE R

THE CURRENT LENGTH OF THE VARIABLE R

.2464136*081

13

( ROW

(ROW

I ) 3)

THE COMPUTED VALUE OF THE CONSTANT NROOTS = .3000800*001
1-11

Programming with DATAPLOT

DATAPLOT programs proceed sequentially from the

beginning of the code to the end. The language is

structured . There are no "Go-to" -type statements

and no statement labels.

Like BASIC, FORTRAN, etc., DATAPLOT has a series

of low-level commands which specify to the

computer that certain elementary operations (such

as reading, writing, looping, etc.) should be

carried out.

In addition, however, DATAPLOT goes beyond BASIC

and FORTRAN in that it allows the analyst to also

make use of a set of high-level commands (such as

PLOT, FIT, HISTOGRAM, etc.) which permit the

analyst to carry out a wide variety of graphics

(continuous or discrete), non-linear fitting, data

analysis, and mathematical operations directly.

Like BASIC, DATAPLOT is an interpretive language.

Although the language may be used in a semi-interactive mode (running pre-stored programs

s at a terminal), and a batch mode (running

9! pre-stored programs with remote output on the

I batch high-speed printer), it was primarily

designed for (and is most effectively used in) an interactive environment

Because of the existence of commonly-used

I high-level graphical and analytical capabilities,

the typical DATAPLOT program is short (e.g., 5 to

. 20 lines). Usually there is only a main

program with no need of subprograms. If

subprograms are desired, they are accessed via the

CALL command.

Input and output in DATAPLOT is format-free . The

READ and SERIAL READ command enter data into

DATAPLOT, the WRITE (with PRINT as a synonym)

command allows the writing of data (back to the

terminal screen or out to a file/subfile )

The DATAPLOT command vocabulary consists of

over 100 commands . The analyst may use any

1 command at any time. A given program for a

I given application typically makes use of a small

subset of DATAPLOT commands (10 to 15 commands).

The 3 most important DATAPLOT commands are PLOT,

FIT, and LET. Other commonly-used commands are

CHARACTERS, LINES, TITLE, ...LABEL (as in YLABEL

,

XLABEL , X2LABEL, and X3LABEL), FONT, TEXT, ECHO,

HARDCOPY, READ, WRITE, and STATUS.

The universal separator between words on a DATAPLOT command line is a blank (1 or more

blanks). The comma is never used in any DATAPLOT

command syntax; when in doubt, use a blank rather

than a comma , as in

WRITE ABC

ft' rather than

WRITE A,B,C
1-12

English-Syntax Language

DATAPLOT is an English-syntax language . Many of

the command statements are identical to their

English- language counterparts , for example,

PLOT

FIT

HISTOGRAM

NORMAL PROBABILITY PLOT

ANOVA

SMOOTH

BOX PLOT

Thus to generate a plot of the function sin(x)/x

for the values starting with x = .1, at increments

of .1, and ending with x = 12, one would enter

PLOT SIN(X)/X FOR X = .1 .1 12

And if the analyst has data in variables Y and X

and wishes to carry out a least squares fit of Y on X with the model y = a+b*exp{ -c*x )

, one would

enter

FIT Y = A+B*EXP(-C*X)

And if the analyst has data in the variable X and

wishes to form a new variable Y defined as the

natural logarithm of X, one enters

LET Y = LOG(X)

The net result is that DATAPLOT programs are easy

to write, easy to understand , and easy to update.

This is particularly important for the analyst

with no prior programming experience

.

Free-Format Language

Command statements appear free- format in columns 1 to 80 of a program line.

The usual separator between components of a command line is a blank (one or more blanks). Thus

to generate a plot of X**2 over the interval of x values starting with x = -3, at increments of .1,

and ending with x = +3, the following is

incorrect —

PLOTX * *2FORX=-3 . 1

3

while the following is correct—

PLOT X**2 FOR X = -3 .1 3

Note the spacing between PLOT, X**2, FOR, X, -3,

.1, AND 3. The spacing here is 1 blank, but

optionally could have been any number of blanks.

The PLOT statement as given here starts in column

1, but optionally could have been any column.

Packing of characters is permitted only in

defining and using functions . Thus

PLOT 3-h2*EXP(-X) FOR X = 0 .16

is correct, as is

PLOT 3 + 2 * EXP(-X) FOR X = 0 .16

and other variations

.

If command statements are longer than 80

characters , then they may be extended onto the[

next line by appending .... at the end of the

first line, as in

PRE-FIT Y = A + B*EXP(-C*X) FOR A FOR B = 1 .12 FOR C - .5 .01 .6 10 1 20

Command statements longer than 2 full lines ( 16C characters ) are not permitted

.

i
Declaration-Free Language Structured Language

The elements of the DATAPLOT language which the

analyst may create, redefine , and operate on are

parameters = named constants

variables = named vectors

functions = named character strings

Names used for parameters/variables/functions may

be up to 8 characters , must start with an alphabetic character , and may thereafter be any

combination of the 26 alphabetic characters and

the 10 numeric characters . Names which are

longer than 8 characters may be used but

only the first 8 characters are scanned and

internally stored.

DATAPLOT is a declaration- free language--one need

not pre-define parameter, variable , and function

names in a separate section unto itself (as with

ALGOL and PASCAL); in fact, one does not pre-define such elements at all —one simply

introduces these elements along the way as needed

by the program and as dictated by the analysis

Once a name is defined (as a parameter, a variable, or a function )

, it remains that type

1 throughout the DATAPLOT run (thus, for example, if

X is used as a variable, it will remain a variable

j for the entire run). If the analyst chooses to change the use of a name (for example, to change a variable X to a function X) in the middle of a run, then the analyst must first delete the name

i (via the DELETE command, as in DELETE X), and then

reuse the name in the desired fashion.

Program execution—whether in the main routine or within a subprogram

)

—always flows from top to bottom, and so DATAPLOT is by design a structured language. DATAPLOT does not have

statement labels and therefore is a "GO-TO-less" language. In practice , because of

the existence of higher-level graphics/analysis

commands, and because of the DATAPLOT feature of

being able to append subset and conditionality

qualifiers at the end of any high-level graphics

and analysis command, the need for such branching

has been virtually eliminated . The net result is

a structured , top-to-bottom language structure

which greatly facilitates the writing and updating

of programs

Branching within a ( sub )program is not permitted;

branching between subprograms may be done via the

CALL command, as in

CALL ANALYSIS.

where ANALYSIS. is the name of the

(analyst-created) file where the subprogram

resides (the period at the end of the file name

tells DATAPLOT that ANALYSIS is the name of a mass

storage file name as opposed to, for example, the name of a parameter, variable, or function)
1-14

Punctuation Language Components

The universal separator for components in a DATAPLOT command line is the space ( = blank). A blank between the words of a command line are

important because DATAPLOT uses such spaces as a separator Spaces around relational operators

(e.g., =, <, >=, etc.), arithmetic operators ( + , -, *, /, and ** )

, and within arithmetic

expressions ;e.g., B**2-4*A*C) may be included or excluded at the preference of the analyst.

Readability considerations suggest that spaces be

included around such operators and in such

expressions

.

Commas serve no purpose in DATAPLOT and may at times be the cause of syntax errors. There are no commands which call for the use of commas in

DATAPLOT; when in doubt, leave a space rather

than a comma. Blanks and spaces within

mathematical and functional expressions are solely

for visual convenience—they may be included or excluded at the discretion of the analyst; as in

LET Y = A+B*EXP( -ALPHA+BETA*X

)

LET Y = A + B*EXP(-ALPHA + BETA*X

)

Command statements appear free-format in columns 1 to 80 of a program line. If a statement is longer

than this, it may be continued onto the next line

by appending a ... at the end of the first line.

Statements longer than 2 full lines ( 160

characters ) are not permitted.

DATAPLOT also expects no punctuation in data files

which are read via the READ and SERIAL READ

commands . Adjacent numbers on a line image may be

free- format but should be separated by at least one blank. Commas between numbers will usually be

ignored by DATAPLOT, but if error messages are generated because of them on a READ, the commas should be replaced by a blank via the local

editor. Alphabetic information up at the

beginning of a data file may be skipped over via

the SKIP command, as in

SKIP 5

which will cause subsequent READ and SERIAL READ

commands to skip over all information on line

images 1 to 5 of the file. The ROW LIMITS command

allows the analyst to focus only on specified line

iamges of a file, as in

ROW LIMITS 6 100

The DATAPLOT language consists of the following

components—

1 ) commands

;

2) arithmetic operators

;

3) relational operators

4) numbers;

5) parameters;

6) variables

;

7) functions

;

8) sub-commands under the LET command;

9) keywords

;

10) in-line text sub-commands

;

11) file and subfile references.

The COLUMN LIMITS command allows the analyst to focus only on certain column limits in reading a file, as in

COLUMN LIMITS 1 50

which would be a way of omitting non-numeric (or

numeric) information beyond column 50.
Commands

2-1

There are 6 DATAPLOT command categories--

Graphics commands;

Analysis commands;

Diagrammatic Graphics commands;

Plot Control commands

Support commands;

Output Device Commands

The first 3 categories are of primary interest

The commands in these categories are all active in

the sense that they all "do something" --a plot is

generated, an analysis (e.g., an ASOVA or a least

squares fit) is carried out, or a geometric figure

(e.g., a box or circle) is drawn out on the

screen. The commands in these categories could

very well constitute an end in itself for the

experimental objectives of the analyst.

On the other hand, the commands, in the last 3 categories are of secondary importance—they are

rarely end objectives of an analysis ; rather these

commands typically play some intermediate role in

assuring that the analyst carries out precisely

the analysis as desired. Typical examples of such

secondary commands are

1) reading data in from a file (reading data

in is never the end objective—it is

only the first step in an analysis )

2) specifying that calculations should be

carried out in degrees rather than

radians for trigonometric calculations

3) specifying the title and labels for

succeeding plots;

4) specifying line types (e.g., dotted) for

succeeding plots;

5) specifying the desired graphics output

device (e.g., the Zeta plotter).

Clearly such commands are not ultimate objectives

in an analysis ; on the other hand, the absence of

such commands would severely handcuff the analyst

in carrying out the desired analysis
2-2

Graphics Commands

All commands in this category generate a plot.

This category provides for the analyst a set of

graphical analysis tools for plotting data and

functions. the most important (and most heavily-used ) command in this category is PLOT. Other frequently-used commands are HISTOGRAM and

PROBABILITY PLOT (especially NORMAL

PROBABILITY PLOT).

Graphics Commands

Command Description Default Example

PLOT Generate plot of var t/or tunc N/A PLOT T X

3-D PLOT Generate 3-dimensional plot of var S/or func H/A 3-D PLOT Z Y X

... HISTOGRAM Generate histogram—cum, rel, or cum rel N/A HISTOGRAM T

... FREQUENCY PLOT Generate frequency plot —cum, rel, or cum rel N/A FREQUENCY PLOT J PIE CHART Generate pie chart N/A PIE CHART Y PERCENT POINT PLOT Generate percent point plot N/A PERCENT POINT PLOT T

. . . PROBABILITY PLOT Generate probability plot (24 distributions) N/A NORMAL PROBABILITY PLOT T

... PPCC PLOT Generate prob plot corr coef plot (9 families

)

N/A WETBULL PPCC PLOT

... NORMALITY PLOT Generate normality plot (Box-Cox family only) N/A BOX-COX NORMALITY PLOT Y

RUN SEOUBNCE PLOT Generate run sequence plot N/A RON SEQUENCE PLOT T LAC ... PLOT Generate lag plot for a given lag number N/A LAG 1 PLOT T

. . . CORRELATION PLOT Generate auto- or cross-correlation plot N/A AUTOCORRELATION PLOT T

. . . SPECTRAL PLOT Generate auto-, cross-, etc spectral plot N/A SPECTRAL PLOT Y

. . . PERIODOGRAM Generate auto- or cross-periodogram N/A PERIODOGRAM Y COMPLEX DEMODULATION .

.

. PLOT Generate complex demodulation amp or phase plot N/A COMPLEX DEMODULATION PHASE

BOX PLOT

I PLOT

. . . CONTROL CHART

Generate box plot Generate I plot Generate mean, ad, or range control chart

N/A

N/A

N/A

BOX PLOT T X

I PLOT Y X MEAN CONTROL CHART Y X
2-3

Analysis Commands

All commands in this category generate printed

output. This category provides the analyst with a set of quantitative/statistical/mathematical tools

which serve as an analytic complement to the

graphical techniques of the prior category . The most important commands in this category are FIT

and LET.

Analysis Commands

Command Description Default Example

LET

LET FUNCTION Define var s param; calc stat; roots/diff/int N/A Define & operate on tunc; differentiate func N/A LBT Y=X**LAMBDA*EXP(-A*X'*2 ) LET FUNCTION F1=A0/ ( 1*B1*X"2 )

SUMMARY Compute summary statistics N/A SUMMARY Y

... FIT

... PRB-FIT

EXACT ... RATIONAL FIT

Perform least squares linear or non-linear fit N/A Perform pre-fit analysis for starting values Perform exact rational function fit N/A

N/A

PIT Y=A+B'EXP(-C'X) PRE-FIT X"A FOR A = 1 .12

EXACT 1/2 RATIONAL FIT Y2 X2 Y X

... SPLINE FIT

... SMOOTH Perform spline fit Perform smoothing of equi-spaced data

N/A

N/A CUBIC SPLINE FIT Y XCUBIC SMOOTB Y

ANOVA MEDIAN POLISH

Perform analysis of variance Perform analysis of variance

N/A N/A ANOVA Y XI X2 ANOVA Y XI X2
2-4

Diagramnat ic Graphics Commands

The commands in this category are used for the

superposition of text on any output, and for the

construction of diagrams, schematics , and

specialized charts. The most important commands

in this category are FONT, HW, JUSTIFICATION,

ERASE, MOVE, TEXT, and COPY.

Diagrammatic Graphics Commands

Command Description Default Example

FONT Specify script font N/A FONT TRIPLEX ITALIC HEIGHT Specify height of letters N/A HEIGHT 10 WIDTH Specify width of letters N/A WIDTH 7 HW Specify height and width of letters N/A HW 10 7 JUSTIFICATION Specify Justification ( left /center/right

)

N/A JUSTIFICATION CENTER CASE Specify script case (upper vs. lower) N/A CASE LOWER

BRASS Erase current screen N/A ERASE

COPY Copy the current screen onto local hardcopy N/A COPY

RING BELL Ring bell N/A RING BELL 10

CROSS-HAIR (or CB) Activate cross-hair N/A CROSS-HAIR A B

TEXT Write out script text N/A TEXT GRAPHICS

HOVE Move to given coordinates on the screen N/A MOVE 50 50 DRAW Draw from present location to specified coor.) N/A DRAW 50 50 60 60

POINT Draw a point N/A POINT 50 50 ARROW Draw an arrow N/A ARROW 50 50 60 60 TRIANGLE Draw a triangle N/A TRIANGLE 50 50 60 50 55 60 BOX Draw a box N/A BOX 50 50 60 60 HEXAGON Draw a hexagon N/A HEXAGON 50 50 60 50 CIRCLE Draw a circle N/A CIRCLE 50 50 60 50 SEMI-CIRCLE Draw a semi-circle N/A SEMI-CIRCLE 50 50 60 50 ARC . . Draw an arc N/A ARC 50 50 60 50 70 40 ELLIPSE Draw an ellipse N/A ELLIPSE 50 50 60 45 70 50 OVAL Draw an oval N/A OVAL 50 50 60 45 70 50 DIAMOND Draw a diamond N/A DIAMOND 50 50 60 45 70 50

AMPLIFIER Draw an amplifier N/A AMPLIFIER 50 SO 60 50 CAPACITOR Draw a capacitor N/A CAPACITOR 50 SO 60 SO GROUND Darw a ground N/A GROUND 50 50 60 SO INDUCTOR Draw an Inductor N/A INDUCTOR SO 50 60 SO RESISTOR Draw a resistor N/A RESISTOR 50 SO 60 SO

AND Draw an and box N/A AND SO SO 60 50 OR Draw an or box N/A OR SO SO 60 SO HAND Draw a nand box N/A NAND 50 50 60 SO HOP Draw a nor box H/A NOR SO SO 60 SO
2-5 Plot Control Commands

The commands in this category allow the analyst to specify the details of plots which are generated

in the Graphics command category. The most

important commands in this category are CHARACTERS, LINES, TITLE, and ...LABEL (especially

YLABEL and XLABEL) .

Command Description Default Example

CHARACTERS Specify plot character types all blank CHARACTERS A B CIRCLE STAR CHARACTER SIZES Specify size (height) for characters on plots red CHARACTERS SIZES 3 3 5 7 LINES Speci fy plot line types all solid Ij.L T TNF^ (V /_<_i ^/^LjJ.LJ ^OTTD iSU DOTI LJt^ DA^H—111 Ut\JIl£ HASH?

TITLE Specify title at top of plot no title TITLE SPECTROMETRIC ANALYSIS

TITLE SIZE Speci fy plot title size (height) a utoma tic TITLE SIZE 4

. . .LABEL Speci fy no labels YLABEL RESPONSE

. . .LABEL SIZE Specify size (height) for labels on plots red X3LABEL COLOR BLUE

. . . MINIMUM Speci fy mini ma for plot a xes a utomatic YMINIMUM 250

. . . MAXIMUM Spec i fy maxi ma fot plot axes automatic YMAXIMUM 300

. . .LIMITS Specify limits (min and max) for plot axes automatic YLIMITS 250 300

BELL Spec2. fy ^) lit" nm^t f- 7 r- n 7 Dt~ h& 7 7 (DM /Ci T?T? ) OFF = no bell BELL ON PRESORT Specify a utoma tic pre—plot sort (ON/OFF

)

ON = pre-sorted PRESORT OFF SEQUENCE Speci fy auto seq number ing for plots ( ON/OFF

)

OFF = no seg numb SEQUENCE ON

. . .GRID Specify plot grid lines (ON/OFF) OFF = no grid lines GRID OFF

. . .LOG Specify axis scale as logari thmic ( ON/OFF

)

OFF = linear scale YLOG ON

. . . FRAME Specify plot frames (ON/OFF) ON = frame FRAME OFF

FRAME CORNER COORDINATES Speci fy plot frame location and shape 15 20 90 90 CORNER COORDINATES 20 20 75 90

LEGEND . .Specify plot legends no legends LEGEND 1 NO CATALYST

LEGEND . . . COORDINATES Specif

y

plot legend positioning 20 85 LEGEND 1 COORDINATES 75 85 LEGEND . . . SIZE Specify size (height) for legends on plots red LEGEND 1 COLOR BLUE

ARROW . . . COORDINATES Spec1 fy location of arrows on plots no default ARROW 2 COORDINATES 29 80 50 50 BOX . . . CORNER COORDINATES Specj. fy 7 or f- i /-i t~i r~i~F hifi yo c nn n ?of"C no default BOX CQi^ER COORDINATES 5 5 9 9 SEGMENT . . . COORDINATES •J pcL. J. L y XUCOt. 7 rii*" a t~ iVJJ i t~M~i of^J-L J.? -LUC ino -3coiTinon Cry/Z/tTJ I /~

L, Oc rtri LJi 1 jJJ-{JL.Z3 n ?ot"C no default SEGMENT 4 30 80 50 50

. . . TIC MARK Specif

y

tic marks on plots ( ON/OFF

)

ON = tic marks TIC MARK OFF

. . . TIC MARK COORDINATES Speci fy plot tic mark pos it i oni ng a utomatic TIC MARK COORDINATES 1500 2500

. . . TIC MARK POSITION Specl fy plot tic mark posi t i onm

g

through the frame TIC MARK POSITION INSIDE

. . . TIC MARK SIZE Specify plot tic mark size automatic TIC MARK SIZE 2

. . . TIC MARK LABEL Specify pioz zic iiiarK laoei 1 mg i uiw/urc j automatic X1TIC MARK LABEL MALE FEMALE

. . . TIC MARK LABEL SIZE Speci f

y

plot tic mark labelling size (height

)

automatic X1TIC MARK LABEL SIZE 2

EYE COORDINATES ^ n&r* 7 F 1

J j. L eye iocation ror j dimensional plot max + 5*range EYE COORDINATES 20 20 50 ORIGIN COORDINATES 5peci fy reference origin for 3~~dimensional plot ( xmin , ymin, zmin) ORIGIN COORDINATES 50 200 200 PEDESTAL Speci fy 3-d plot with pedestal (ON/OFF) OFF = no pedestal PEDESTAL ON

PEDESTAL SIZE Specify size for pedestal on plots red PEDESTAL SIZE 2000 VISIBLE Specify 3-d bkgrd lines visibility (ON/OFF) ON = visible VISIBLE OFF

CHARACTER COLORS Specify colors for characters on plots red CHARACTER COLORS RED BLUE GREEN

LINE COLORS Specify colors for lines on plots red LINE COLORS RED BLUE GREEN YELLOW

TITLE COLOR Specify color for title on plots red TITLE COLOR ORANGE

. . .LABEL COLOR Specify colors for labels on plots red XLABEL COLOR GREEN

. . . FRAME COLOR Specify colors for frame on plots red FRAME COLOR RED

. . . TIC MARK COLOR Specify color of tic marks on plots red TIC MARK COLOR BLUE

. . . TIC MARK LABEL COLOR Specify color for tic mark labelling on plots red XlTIC MARK LABEL COLOR RED

BACKGROUND COLOR Specify color of background on plots blue BACKGROUND COLOR GREEN

MARGIN COLOR Specify color of margin on plots blue MARGIN COLOR GREEN

LEGEND . . . COLOR Specify color for legends on plots all red LEGEND 1 COLOR BROWN

ARROW . . , COLOR Specify colors for arrows on plots red ARROW 2 COLOR BLUE

SEGMENT . . . COLOR Specify colors for line segments on plots red SEGMENT 4 COLOR BLACK

BOX . . . COLOR Specify colors for box frame on plots red BOX 3 COLOR GREEN

PEDESTAL COLOR Specify color of pedestal on 3d-plots red PEDESTAL COLOR GREEN
2-6

Support Commands

The commands in this category allow the analyst to carry out important secondary operations (such as input/output) , and to specify a variety of

settings which will allow an analysis to be

tailored precisely to one's specifications . The most important commands in this category are READ, END OF DATA, WRITE, ECHO, EXIT, STATUS, and HELP.

Support Commands

Command Description Default Example

READ

SERIAL READ

WRITE SKIP ROW UMTS

COLUMN LIMITS BND OP DATA

Read variables Read variables serially Write ( terminal /mass storage] var, param, func Specify number of header lines to skip for READ

Specify row limts for READ and SERIAL READ

Specify column limts for READ and SERIAL READ

Define end of data for READ and SERIAL READ

Read from terminal Read from terminal Write to terminal

0 » no lines rows 1 to infinity

columns 1 to 132 N/A

READ CALIB . T X

SERIAL READ CALIB WRITB CALIB2. Y X

SKIP 5 ROW LIMITS SO 100 COLUMN LIMITS 10 40 BND OF DATA

Y X

LAB PRED RES

ECHO

FEEDBACK

PRINTING

Specify auto echo of command lines (ON/OFT) OFT

Allow/suppress all feedback printing (ON/OFF) ON • Allow/suppress all analysis printing ION/OFF) ON c

« no echo ECHO ON allow messages FEEDBACK OFF printing PRINTING OFF

RESET

SAVE RESTORE

EXIT

'Zero-out' all var, param, func, etc N/A Dump all var/param/func to mass storage H/A Restore all saved var/param/func from mass stg N/A

Exit from DATAPLOT N/A

RESET

SAVE SCRATCB4

RESTORE SCRATCB4. EXIT

STATUS

DIMENSION

Print status of all lines, char, var, param

Specify dimensions of Internal data storage

N/A

10 var x 1000 obs

STATUS

DIMENSION 20 VARIABLES

DELETE RETAIN

NAME

Delete variables or elements of a variable N/A Retain variables or elements of a variable N/A Assign (equate) additional names to variables N/A

DELETE Y(S) X(5) LABIS) RETAIN Y X MAT SUBSET LAB 4 NAME Y 1 X 2 LAB 3

COMMENT Insert a comment line in code

Insert a comment line in code

N/A N/A COMMENT DILUTION ANALYSIS

. CARRY OUT ANALYSIS ON LAB 4

IMPLEMENT

PRE-BRASB

Activate local change to DTPLT . implementation As initialized

Specify auto pre-erase for plots (ON/OFF) ON pre-erase

IMPLEMENT 3

PRE-BRASB ON

CREATE BND OF CREATE

CALL

Create a subprogram N/A

End Creation of a subprogram N/A Execute a DATAPLOT subprgm from mass stg N/A

CREATE PR0G3. BND OF CREATE

CALL PROG3.

LOOP END OF LOOP

Initiate a loop Terminate a loopN/A N/A

LOOP FOR A - 2 .1 5 END OF LOOP

IFBND OF IF Define start of conditionally-executed code

Define end of cond tionally-executed code

N/A

N/A IF FOR A > 5 BHD OF IF

TRIGONOMETRIC UNITS RADIANS

DEGREES GRADS

Specify trigonometric units radians Specify radians for trig calculations (ON/OFF) ON = radians Specify degrees for trig calculations ION/OFF) OFF = radians

Specify grads for trig calculations (ON/OFF) OFF - radians

TRIGONOMETRIC UNITS DEGREES RADIANS ON

DEGREES ON GRADS ON

CLASS ...LOWER CLASS ...UPPER CLASS . . . WIDTHSpec, first class lover 11m for HISTOGRAM, etc xbar - 6*s

Spec, last class upper lim for HISTOGRAM, etc xbar * 6*s Specify class width for HISTOGRAM, etc 0.3*s

CLASS LOWER -ISO CLASS UPPER ISO CLASS VIDTH 10

DEMODULATION FREQUENCY

FILTER WIDTH

Specify frequency for complex demodulation

Specify filter width for SMOOTH

no default

3 DEMODULATION FREQUENCYFILTER WIDTH 7

FIT CONSTRAINTS

FIT ITERATIONS

FIT POWER FIT STANDARD DEVIATION

Specify constraints for FIT S PRB-FIT

Specify upper bound on Iterations for FIT Specify fit criterion power for PRE-FIT i FIT

Specify lower bound on res ad for FIT

OFF - no constraint FIT CONSTRAINTS A .OB'S

SO FIT ITERATIONS 30

2 least squares FIT POWER 1 .0OO00S FIT STANDARD DEVIATION .0001

KNOTS

HEIGHTS Specify knots variable for SPLINE

Specify weights variable for FIT, PRB-FIT, etc OFF « no knots KNOTS 10 20 40 80 OFF equl-weighted WEIGHTS W
2-7

COMMUNICATIONS LINK BAUD RATE

BOST

CURSOR COORDINATES

CURSOR SIZE

ERASE DELAY

HARDCOPY DELAY

HELP

SEWS

MAIL

BUGS

OPBRATCH MESSAGE

TIME

PROBE SET

Specify link (phone, network , etc.) to host Specify baud rate Specify host computer

Specify cursor coordinates after a command

Specify cursor size after a plot

Specify delay factor for erase Specify delay factor for hardcopy

the • local' link

9600

the "local' host

Next line

1.5

1

1

Print short documentation for a given command List 7 categories

Print general news from DATAPLOT service org no default

Print message from DATAPLOT service org to user no default

List known bugs no default

Send a message to the host console operator N/A Write message to DATAPLOT service organization no default Display (wall clock) time and elapsed run time H/A

Dump contents of underlying FORTRAN parameter

Set contents of underlying FORTRAN parameter

N/A

N/A

COMMUNINCATIONS LINK NETWORK BAUD RATE 9600 BOST VAX 11/780

CURSOR COORDINATES 5 5 CURSOR SIZE 3

ERASE DELAY 3 HARDCOPY DELAY 3

HELP PLOT

NEWS MAIL SMITH

BUGS

OPERATOR WHEN SCHEDULED REBOOT? MESSAGE CALL J. SMITH (EXT. 3862 TIME

PROBE NUMCOL SET NUMCOL

TERMINATOR CHARACTER Specify character to terminate commands TERMINATOR CHARACTER 0
2-8

Output Device Commands

The commands in this category deal with the

specification of output devices. As with the

previous category, the commands in this category

are secondary in nature. The most important

commands in this category are HARDCOPY, DISCRETE,

BATCH, and TERMINAL.

Output Device Commands

Command Description Default Example

TERMINAL Specify terminal model or power (ON/OFT) TEKTRONIX 4014 TERMINAL TEKTRONIX 402~> CONTINUOUS Specify continuity (ON/OFF) for terminal ON CONTINUOUS ON PICTURE POINTS Specify number of picture points for terminal 4096 BY 3024 PICTURE POINTS 72 24 COLOR Specify color (ON/OFF) for terminal OFF COLOR ON

DISCRETE Specify primary output —discr nw term (ON/OFF] OFF - contln term DISCRETE NARROW-WIDTH ON DISCRETE NARROW-WIDTH Specify primary output —discr nw term (ON/OFF] OFF » contin term DISCRETE NARROW-WIDTH ON BATCH Specify primary output —batch (ON/OFF) OFF contin term BATCH ON

DISCRETE WIDE-CARRIAGE Specify primary output-—discr wc term (ON/OFF) OFF « contin term DISCRETE WIDE-CARRIAGE ON

HARDCOPY Specify secondary output —local hdcpy (ON/OFF) OFF no hdcpy outp HARDCOPY ON

PBNPLOTTBR Specify secondary output —penplotter (ON/OFF) OFF no penpl outp PBNPLOTTBR ON

CALCOHP Specify secondary output—Calcomp (ON/OFF) OFF •= no Calcp outp CALCOMP ON

VERSATBC Specify secondary output —Versatec (ON/OFF) OFF * no Vers outp VERSATBC ON

ZETA Specify secondary output —Zeta (ON/OFF) OFF » no Zeta outp ZETA ON

DEVICE ... POWER Specify power (ON/OFF) for m device ON for dev 1 (only) DBVICB 2 POWER ON DEVICE ... MANUFACTURER Specify manufacturer for a device ON for dev 1 (only) DEVICE 2 MANUFACTURER FR-80 DEVICE . .

.

CONTINUOUS Specify continuous (ON/OFF) for a device ON for dev 1 ( onl y

)

DEVICE 3 CONTINUOUS ON

DEVICE . .

.

PICTURE POINTS Specify number of picture points for a device 4096 by 3124 DEVICE 1 PICTURE POINTS 4096 DEVICE ... COLOR Specify color (ON/OFF) for a device ON for dev 1 (only) DEVICE 1 COLOR ON

0|

I
2-9

Keywords

Keywords are reserved words which are not commands

in themselves , £>ut rather are special words which

may appear at various points within a command

line. Some keywords are built-in parameter names

(such as PI, INFINITY, RESSD, etc.); some keywords

are built-in variable names (such as PRED and

RES); some keywords are components in other

commands (such as VERSUS and AND for PLOT); some keywords are optional and powerful extensions to a variety of commands (such as SUBSET, EXCEPT, and

FOR). The most important keywords are AND,

VERSUS, SUBSET, EXCEPT, FOR, PRED, RES, and =.

Keywords

Description Default Exampl

Used with PLOT, etc for multi-trace plots

Used with PLOT, etc for multi-trace plots

Qualifier denoting suhset of Interest Qualifier denoting excepted subset Qualifier denoting elts or var of interest

Var denoting dummy index; used in FOR Specify interval of values within a variable

Parameter with value 3.1415926

Par am with value 'infinity'

Var with predicted values from FIT, etc

Var with residuals from FIT, ANOVA, etc

N/A

N/A

N/A N/A N/A

N/A

N/A

3.1415926

largest real value

N/A

N/A

Par am with res sd from FIT, ANOVA, etc N/A Param with res deg of freedom from FIT etc N/A Param with replication sd from FIT, ANOVA, etc N/A Param with rep deg of freedom from FIT etc N/A Param with lack of fit cdf value from FIT, etc N/A

PLOT Y X AND

PLOT Yl Y2 Y3 VERSUS X

PLOT Y X SUBSET LAB 4 FIT Y*A+X"B EXCEPT LAB 9 PLOT SIN(X) FOR X - 0 .1 6.3 LET Yd) - X(I*20) FOR I « 1 1 20 PLOT Y X SUBSET LAB 4 TO 9

LET Y - SIN(2'PI'F'T) DELETE Y X FOR Y - 50 TO IN

PLOT Y PRED VERSUS X

PLOT RES X

PRINT RESSD

PRINT RBSDF

PRINT REPSD

PRINT REPDF

PRINT LOFCDF

•With respect to' ; used with LET for roots, etc N/A LET FUNCTION ^DERIVATIVE F WRT X

COBF COBFSD

DBMODF

ON

OFF AUTOMATIC

DEFAULT

VERTICALLY

Var where FIT, ANOVA, etc coef stored N/A

Var where FIT, ANOVA, etc coef sd stored N/A

Param with updated complex demodulation freq N/A

Set a switch to 'on' position N/A

Set a switch to 'off position N/A

Set a switch to 'automatic' position N/A

Set a switch to 'default' position N/A

Rotate contents (but not frame) of plot N/A

PRINT COBF

PRINT COBFSD

PRINT DBMODF

CALCOHP ON

CALCOMP OFF

LIMITS AUTOMATIC

EYE COORDINATES DEFAULT

PLOT VERTICALLY X"2 FOX X*0 1 10

<>

<

>V

•Equal'i used in FIT, PRB-FIT, FOR, etc

'Not equal to'

'Less than'

'Ijess than or equal to* 'Greater than" 'Greater than or equal to'

Terminator character for a command Continue any statement onto next line

N/A

N/A

N/A

N/A

N/A

N/A

N/A

N/A

FIT Y - A*B'LOG(-C*X) LET Y - 1/X SUBSET X <> 0 FIT Y - U*SXP(-A*X) SUBSET X t 2 FIT r » U*SXP(-A*X) SUBSET X t- J DELETE Y X LAB SUBSET Y > 100 DELETE Y X LAB SUBSET T >- ICO

PLOT Y PRED VS X; PLOT RES X

FIT Y m AO * Al/X * A2/... X"2 * A3/X"3
i
3-1

Arithmetic Operations

As with FORTRAN, the DATAPLOT language uses the

following symbols for arithmetic operations—

+ addition

subtraction

* multiplication

/ division

** exponentiation

Also, operations are performed left to right with

priorities defined in a fashion identical to FORTRAN—

1 ) exponentiation

2) multiplication and division

3) addition and subtraction

Also as in FORTRAN, the order of operations may be

altered by use of parentheses—with operations in

parentheses being performed first.

The 3 most important DATAPLOT commands are

PLOT

FIT

LET

'These 3 commands also have the most common

occurrence of arithmentic operations , as in

PLOT 10+X**2 FOR X = 1 1 10

which would generate a plot of 10 + X**2 for the

values X = 1, at increments of 1, up to 10 (that

is, X = 1, 2, ... 10).

FIT Y = A+B*L0G(C+X**2

)

would carry out a non-linear fit of Y on X with

'.the model A + B*LOG(C + X**2)

LET A = X*Y+Z**2

would compute the parameter or variable A from the

parameters or variables X, Y, and Z. If X, Y, and

2 were all parameters , then A would become a parameter. If any of the X, Y, or Z were

variables , then A would become a variable.

It is also possible to use arithmetic operators in

the definition of functions , as in,

LET FUNCTION F = X**2

LET FUNCTION G = 10 *Y LET FUNCTION H = A+F/G

which would result in the creation of the

functions P, G, and H where F - X**2, G = 10*Y,

and H = A+(X**2)/(10*Y) . Note that DATAPLOT

would automatically provide the needed parentheses

in the definition of H.

Relational Operations

DATAPLOT has 6 relational operators—

= equality

<> inequality

< less than

<= or =< less than or equal to

> greater than

>= or => greater than or equal to

The spacing within such operators is important —

using > = instead of >= will lead to a syntax

error or possible erroneous results. Thus to generate a plot of Y versus X but with the plot

restricted to those X and Y values for which the LAB variable is 7 or greater, the proper entry is

PLOT Y X SUBSET LAB >= 7

while

PLOT Y X SUBSET LAB > = 7

is incorrect.

Spacing around such relational operators is

optional and at the analyst's discretion. The

following are equivalent—

PLOT Y X SUBSET LAB >= 7 PLOT Y X SUBSET LAB>=7

FIT Y = A+B/X

FIT Y=A+B/X

LET Y = ( X**LAMBDA) / ( LAMBDA+1

)

LET Y=(X* *LAMBDA)/ ( LAMBDA+1

)

Good programming practice and readability , however,

suggest that relational operators be surrounded by

a blank, as in

PLOT Y X SUBSET X < 100

rather than

PLOT Y X SUBSET X<100
3-2

Numbers

Numbers are unnamed scalars. They may appear in a variety of different kinds of commands ; note the

20 and 50 in

BOX 20 20 50 50

note the 0, .1 and 10 in

PLOT SIN(X) FOR X = 0 .1 10

note the 2,5 in

LET Y = X+2.5

note the 2 in

FIT Y = A+B*X+C*X**2

With the exception of the FIT and PRE-FIT

commands , the general rule in DATAPLOT is that

anywhere a number appears in a command line, it

could equally well have been replaced by a parameter , as in the following analogues to the

above—

LET XI = 20 LET Yl = 20 LET X2 = 50 LET Y2 = 50

BOX XI Yl X2 Y2

LET START = 0 LET INC = .1 LET STOP =10

PLOT SIN(X) FOR X = START INC STOP

LET A = 2.5

LET Y = X+A

The FIT and PRE-FIT commands are an exception

because the command lines

LET D = 2 FIT Y = A+B*X+C*X**D

then the decimal point and trailing decimal digits

should of course be included . However, if the

number happens to be an integer, then the

analyst has the choice of including or excluding

the trailing decimal point, and including or excluding any trailing zeros—thus the following

are all equivalent —

LET Y = X**2

LET Y = X**2. LET Y = X**2.0

LET Y = X**2.00

All such expressions will be stored and processed

internally by DATAPLOT in an identical fashion—

the analyst gains nothing by including the

trailing decimal point and zeros. Simplicity

dictates that the first form be used, but if the

analyst prefers to use other forms, the results

will be identical

.

To define numbers with large exponents (for

example, 7.4 raised to the 15th power), the

analyst should use the ** (exponentiation)

operator directly , as in

LET A = 7.4**15

The E format (as occurs in FORTRAN) is not

permitted ; thus

LET A = 7.4E15

is not a valid DATAPLOT command.

Negative exponents are handled in a similar

fashion, as in

LET B = 7.4**(-15)

ij

will not be treated in the same manner as

FIT Y = A+B*X+C*X**2

In the first case, DATAPLOT will realize that

D is a parameter and so (like all parameters

appearing in a fit) will determine the least

squares estimate for the parameter D along with

the other parameters A, B, and C. However, in

the second case (FIT Y = A+B*X+C*X**2 )

,

DATAPLOT will note the scalar number 2 and

fit for the parameters A, B, and C only. Be aware of this distinction in carrying out fits and

pre-fits .

All numbers are stored internally in DATAPLOT as single precision floating point. If the analyst

wishes to specify a decimal number, as in

LET Y = X**2.378
3-3

Parame ters

LET

1 parameter is a named scalar and may be defined

ria the LET command, as in

LET A = 17.26 LET B = 3.97 LET C = -5.38

LET D = 2.4*10**(-8) LET E = B**2-4*A*C

LET F = MEAN X

"wo internally-provided parameters which the

malyst may use are

PI

INFINITY

|?I has the value 3.14159265; INFINITY has the

-alue of the largest floating point number which

the user 's computer may store (that is, INFINITY = machine infinity). PI and INFINITY may

pe used at any time and like any other user-

'lefined parameter, for example,

il PLOT ( 1/SQRT( 2*PI ) ) *EXP( -0 . 5*X**2 ) FOR X = -3 .1 3

FIT Y = A+B*X**C EXCEPT X 100 TO INFINITY

lie wary of the use of PI in FIT and PRE-FIT

Expressions ; like all parameters , DATAPLOT will

ittempt to determine least squares estimates for

It. Thus rather than use

FIT Y = AMP * SIN( 2*PI*F*X)

me should explicitly use

FIT Y = AMP * SIN( 2*3.14159265*F*X

)

?ith the exception of the above-mentioned FIT and

\>RE-FIT exclusion, parameters may be substituted

"'nywhere in which numbers appear. For example,

'.uppose the analyst wished to override the usual

>lot frame coordinates and specify that all

ucceeding plots have lower left corner at (20,50)

\.nd for the plot to be 30 units wide and 30 units

:igh (that is, have the upper right corner at 50,80). This may be done explicitly by

FRAME CORNER COORDINATES 20 50 50 80

It alternatively

LET XI = 20 LET Yl = 50 LET X2 = 50 LET Y2 = 80 FRAME CORNER COORDINATES XI Yl X2 Y2

This capability of substituting parameters for

numbers is especially convenient for diagramconstruction on terminals which have built-in

hardware for inputting screen coordinates via

cross-hair, light-pen, or equivalent. Suppose

it is desired to draw a line between 2 points on

the screen which the analyst will interactively

specify via the cross-hair . One way is to

1) raise the cross-hair (via CROSS-HAIR )

2) position it to the first point (via the

thumbwheels )

3) input and print the coordinates (via

hitting any key (on Tektronix terminals )

,

or by hitting some predesignated key (on

other terminls);

4) raise the cross-hair (via CROSS-HAIR)

5) position it to the second point (via the

thumbwheels )

6) print the coordinates (via hitting any

key ) ;

7) draw the line (via, for example,

DRAW 20.4 35.3 78.4 80.5).

An easier way which avoids the handling of

absolute numbers and replaces it with the handling

of symbolic parameter names is

1) raise the cross-hair (via CROSS-HAIR XI Yl);

2) position it to the first point (via the

thumbwheels )

3) copy the coordinates into XI and Yl (via

hitting any key);

4) raise the cross-hair (via CROSS-HAIR X2 Y2 )

5) position it to the second point (via

thumbwheels )

6) copy the coordinates into X2 and Y2 (via

hitting any key);

7) draw the line (via DRAW XI Yl X2 Y2).

LET XI = 20 LET Yl = 50 LET X2 = Xl+30

LET Y2 - Yl+30

FRAME CORNER COORDINATES XI Yl X2 Y2
3-4

Var i ab 1 es

LET , READ, and SERIAL READ

A variable is a named vector (a named

single-dimension array), and may be defined via

the LET, READ, and SERIAL READ commands, as in

LET Y = SEQUENCE 1 1 10

LET Z = PATTERN 12 3 FOR 1=119

LET U = NORMAL RANDOM NUMBERS FOR 1=1 1 100

LET X2 = X**2-LOG(Y

)

LET Y2 = SQRT(X+Y**3

)

or

READ X Y

1 1 2 4

3 9 4 16

5 25

END OF DATA

or

SERIAL READ X Y 1124394 16 5 25 END OF DATA

Variables are the most commonly-handled component

in DATAPLOT, as in

PLOT Y X

FIT Y = A+B*LOG(X+C)

LET X2 = LOG(X)

Names for variables , parameters , and functions may

be of any length, but since only the first 8 characters are scanned and internally stored, no 2 names should be identical for the first 8 characters. Names must start with an alphabetic

character, but may be any combination of

alphabetic and numeric characters thereafter. It is the author's personal practice (which

shows up throughout this manual) to follow the usual mathematical custom of using

characters toward the end of the alphabet

(X's, Y's, Z's, etc.) to represent variables, of

using characters toward the beginning of the

alphabet (A's, B's, C's, etc.) to represent

parameters , and of using characters in the

vicinity of F (e.g., F's, G's, H's, etc.) to represent functions . Note, however, that this is

personal preference and not a DATAPLOT

requirement

.
3-5

Functions Evaluating Functions

LET FUNCTION LET

A function is a named character string, and may be

defined via the LET FUNCTION command, as in

LET FUNCTION F = EXP(-05 *X**2

)

LET FUNCTION G = SIN( 2*PI*W*T

)

LET FUNCTION H = F+LOG(G) LET FUNCTION F2 = DERIVATIVE F WRT X

Functions may be concatenated and built-up

piece-by-piece , as in

LET FUNCTION NUH = EXP ( -ALPHA*X

)

LET FUNCTION DENOH = A+B*X

LET FUNCTION RATIO = NUH/DENOH

which is equivalent to

LET FUNCTION RATIO = EXP ( -ALPHA *X )/ (A+B*X

)

Functions may be defined before (or after) the

parameters and variables contained in them are

'created, as in the following example involving a variable transformation—

LET FUNCTION F = X**2

SERIAL READ X

12 3 END OF DATA

LET Y = F

This last statement (LET Y = F) is equivalent to

LET Y = X**2

and will (upon execution) result in the Y variable

having the values 1, 4, and 9.

A more common example of functions being defined

prior to use is in fitting—

LET FUNCTION Fl = A1+B1*SQRT(X

)

LET FUNCTION F2 = A2+B2*LOG(X)

READ X Y

1 1 2 1.5

3 2

4 2.3

5 2.5

END OF DATA

FIT Y = PI FIT Y = F2

The LET FUNCTION command and the LET command carry

out 2 distinctly different operations-- the LET

FUNCTION command allows the analyst to create

functions ; the LET command allows the analyst to carry out function evaluations

For example, suppose it is desired to evaluate the

function sqrt( 1-0 . 3*x**2 ) over the region x = 0 (.01) 1. This may be done in a number of ways;

the most direct way is

LET X = SEQUENCE 0 .01 1 LET Y = SQRT( 1-0 ,3*X**2

)

WRITE X Y PLOT Y X

The first LET command makes use of the SEQUENCE

sub-capability of the LET command to create the

variable X with a sequence of 101 values in it —

.00, .01, .02,. .03, .99, 1.00. The second

LET command creates a variable Y (also with 101

elements ) which has the desired function evalution

values in it. The WRITE command generates a list

of X and Y values. The PLOT command will generate

a plot of Y (vertically ) versus X (horizontally )

A second way to evaluate the function would be

LET X = SEQUENCE 0 .01 1 LET FUNCTION F = SQRT( 1-0.3 *X**2

)

LET Y = F WRITE X Y PLOT Y X

As before, the first LET statement would create

the variable X with the specified sequence of 101

values. The LET FUNCTION command would then

create the function F consisting of the following

16 characters—SQRT( 1-0 . 3*X**2 ) . Note that the

LET FUNCTION does not carry out a function

evaluation—it merely creates a function. The LET

Y = F command would then recognize F as a pre-defined function, replace the name F with the

specified 16-character string, and carry out the

function evaluation . As before, the WRITE command

prints out the results of the function evaluation

and the PLOT command plots out the results of the

function evaluation.

Note that if our ultimate objective is to simply

plot the function (rather than creating variables

containing evaluated values of the function) , then

the above code could be shortened directly to

PLOT SQRT( 1-0 ,3*X**2 ) FOR X = 0 .01 1

or

LET FUNCTION F = SQRT( 1-0 . 3*X**2

)

PLOT F FOR X = 0 .01 1
3-6

Sub-commands Under the LET Command

Statistics, Mathematics, Random Number s , Manipulation

LET

The LET command is the single most powerful

command in DATAPLOT . The most important

capability of the LET command is carrying out function evaluations and variable transformations

.

Such evaluations/transformations are general —any

Fortran-like expression may be used.

In addition , the LET command may also be used by

the analyst to carry out a broad spectrum of

statistical, mathematical, and manipulative

operations . These operations are specified by

inclusion of sub-commands under the LET command.

These sub-commands fall into 4 general

categories —

1. Computing Statistics

2. Performing Mathematical Operations

3. Generating Random Numbers

4. Miscellaneous
3-7

SUB-COMMANDS UNDER THE LET COMMAND

Computing Statistics on a Variable

(Input is a variable; output is a parameter

)

Description Sub-Command Bxamv I e

Compute sample size (number of observations

)

SIZE (or NUMBER) LET A = SIZE Y

Compute sample mean MEAN LET A MEAN Y Compute sample median MEDIAN LET A MEDIAN

Compute sample mi drange MIDRANGE LET A MIDRANGE Y Compute sample midmean MIDMEAN LET A MIDMEAN Y

Compute sample range RANGE LET A RANGE Y Compute sample standard deviation STANDARD DEVIATION LET A STANDARD DEVIATION Y Compute sample variance VARIANCE LET A VARIANCE Y Compute sample relative standard deviation RELATIVE STANDARD DEVIATION LET A RELATIVE STANDARD DEVIATION Y Compu te standard deviation of the mean STANDARD DEVIATION OF THE MEAN LET A STANDARD DEVIATION OP THE MEAN

Compute sample third central moment THIRD CENTRAL MOMENT LET A THIRD CENTRAL MOMENT

Compute sample skewness (stand. 3rd cent, mom > SKEWNESS LET A SKEWNESS Y

Compute sample fourth central moment FOURTH CENTRAL MOMENT LET A FOURTH CENTRAL MOMENT Y Compute sample kurtosis (stand. 4th cent, mom ) KURTOSIS LET A KURTOSIS Y

Compute sample minimum MINIMUM LET A MINIMUM Y Compute sample maximum MAXIMUM LET A MAXIMUM Y Compute sample lower quartile LOWER QUARTILE LET A LOWER QUARTILE Y Compute sample upper quartile UPPER QUARTILE LET S UPPER QUARTILE Y Compute sample lower hinge LOWER HINGE LET A LOWER HINGE Y Compute sample upper hinge UPPER BINGE LET A UPPER HINGE Y

Compute sample autocovariance AUTOCOVARIANCE LET A AUTOCOVARIANCE Y Compute sample autocorrelation AUTOCORRELATION LET A AUTOCORRELATION Y

Compute sample covariance COVARIANCE LET A COVARIANCE Y X

Compute sample correlation CORRELATION LET A CORRELATION Y X Compute sample rank covar iance RANK COVARIANCE LET A RANK COVARIANCE Y X

Compute sample rank correlation RANK CORRELATION LET A RANK CORRELATION Y X
3-8

Performing Mathematical Operations on a Variable

(Part 1 —Input is a variable; output is a parameter)

Description Sub-Comaand Bxample

Compute sum of elements in a variable SUM

Compute product of elements in a variable PRODUCT

Compute integral of elements in a variable INTEGRAL

LET A = SUM Y LET A = PRODUCT Y LET A = INTEGRAL Y X

Performing Mathematical Operations on a Variable

(Part 2—Input is a variable; output is a variable)

Desc ription Sub-Command Bxample

Compute cumulative sums of elts in a var Compute cumulative products of elts in a var Compute emulative integrals of elts in a var

CUMULATIVE SUM

CUMULATIVE PRODUCT

CUMULATIVE INTEGRAL

LET Y2 = CUMULATIVE SUM Y LET Y2 = CUMULATIVE PRODUCT Y LET Y2 = CUMULATIVE INTBGRAL Y X

Compute sequential differences of elts in a var SEQUENTIAL DIFFERENCE LET Y2 = SEQUENTIAL DIFFERENCE Y

Sort the elements in a variable Rank the elements in a variable

Code the elements in a variable

SORT

RANK

CODE

LET Y2 LET Y2 LET Y2SORT Y RANK Y CODE Y

Compute convolution of elts in 2 var CONVOLUTION LET Y2 = CONVOLUTION Y X

Performing Mathematical Operations on a Function

Description Sub-Command Bxample

Compute roots of a function Compute derivative of a function Compute definite integral of a functionROOTS DERIVATIVE

INTEGRAL

LET Y2 = ROOTS EXPl -X )-SIN( X ) WRT X FOR X=0 TO LET A = DERIVATIVE SQRTl EXP(-X*'2 ) WRT X FOR X= LET A - INTEGRAL EXP(-X**2) WRT X FOR X = -3 TC
3-9

Generating Random numbers

Description Sub-Command Example

Generate normal N(0,1) random numbers NORMAL RANDOM NUMBERS LET Y - NORMAL RANDOM NUMBERS FOR I = 1 1 50 Generate uniform (0,1) random numbers UNIFORM RANDOM NUMBERS LET Y = UNIFORM RANDOM NUMBERS FOR I «= 1 1 50 Generate logistic random numbers LOGISTIC RANDOM NUMBERS LET Y LOGISTIC RANDOM NUMBERS FOR I = 1 1 50 Genera te double exponential rand numb DOUBLE EXPONENTIAL RANDOM NUMBERS LET Y

_ DOUBLE EXPONENTIAL RANDOM NUMBERS FOR I = Generate Cauchy random numbers CAUCHY RANDOM NUMBERS LET Y = CAUCHY RANDOM NUMBERS FOR I = 1 1 50 Generate Tukey lambda random numbers TUKEY LAMBDA RANDOM NUMBERS LET Y lUKEi LAMBDA RANDOM NUMBbRS FUR I — 1 1 !>i Generate semi-circular random numbers jCni ~C IH^ULm^LK KANLAJn NUnDCiKS LET Y SEMI-CIRCULAR RANDOM NUMBERS FOR 1=11.

Generate triangular random numbers TRIANGULAR RANDOM NUMBERS LET Y TRIANGULAR RANDOM NUMBERS FOR I = 1 1 50

Generate lognormal random numbers LOGNORMAL RANDOM NUMBERS LET Y LOGNORMAL RANDOM NUMBERS FOR I = 1 1 SO Generate halfnormal random numbers HALFNORMAL RANDOM NUHBERS LET Y BALFNORMAL RANDOM NUMBERS FOR I = 1 1 50 Generate t random numbers T RANDOM NUMBERS LET Y T RANDOM NUMBERS FOR I = 1 1 50 Generate chi-sguared random numbers CHI-SQUARED RANDOM NUMBERS LET Y CHI-SQUARED RANDOM NUMBERS FOR I = 1 1 50 Generate F random numbers F RANDOM NUMBERS LET Y F RANDOM NUMBERS FOR I = 1 1 50

Generate exponential random numbers EXPONENTIAL RANDOM NUMBERS LET Y EXPONENTIAL RANDOM NUMBERS FOR I = 1 1 50 Generate gamma random numbers GAMMA RANDOM NUMBERS LET Y GAMMA RANDOM NUMBERS FOR I = i 1 50 Generate beta random numbers BETA RANDOM NUMBERS LET Y BETA RANDOM NUMBERS FOR 1=1 1 50 Generate Ueibull random numbers WEIBULL RANDOM NUHBERS LET Y WEIBULL RANDOM NUMBERS FOR I = 1 1 50 Generate extr value type 1 rand numb EXTREME VALUE TYPE 1 RANDOM NUMBERS LET Y EXTREME VALUE TYPE 1 RANDOM NUMBERS FOR I Generate extr value type 2 rand numb EXTREME VALUE TYPE 2 RANDOM NUMBERS LET Y EXTREME VALUE TYPE 2 RANDOM NUMBERS FOR I Generate Pareto random numbers PARETO RANDOM NUMBERS LET Y PARETO RANDOM NUMBERS FOR I = 1 1 50

Generate binomial random numbers BINOMIAL RANDOM NUMBERS LET Y BINOMIAL RANDOM NUMBERS FOR I = 1 1 50 Generate geometric random numbers GEOMETRIC RANDOM NUMBERS LET Y GEOMETRIC RANDOM NUMBERS FOR I = 1 1 50 Generate Poisson random numbers POISSON RANDOM NUMBERS LET Y POISSON RANDOM NUMBERS FOR I = 1 1 50 Generate negative binomial random numb NEGATIVE BINOMIAL RANDOM NUMBERS LET Y NEGATIVE BINOMIAL RANDOM NUMBERS FOR I =

Generate a random permutation RANDOM PBRMUTATION LET Y RANDOM PERMUTATION FOR 1=1 1 50

Miscellaneous

Description Sub-Command Example

Generate a seguence within a var Generate a patterned seg within a var

Extract distinct elements from a var

SBQUENCB PATTERN

DISTINCT

LET Y = SEQUBNCB 1 .1 10 LET Y = PATTERN 12 3 4 5 FOR I * 1 1 60 LET Y = DISTINCT X
3-10

For category 1 (Computing Statistics )

, the input

is always a variable and the output is always a parameter . For example, if Y is a variable, then

LET A MEAN Y

computes the mean of the data in the variable Y and places the result into the parameter A.

For category 2 (Mathematical Operations) , there

are 3 sub-categories—

For category 3 (Computing Random Numbers ) , the FOR

qualification at the end of the command statement

tells DATAPLOT not only how many random numbers toi generate but also where (into what elements of the

variable ) to place the random numbers. Thus

LET Y = NORMAL RANDOM NUMBERS FOR I = 1 1 50

generates 50 normal N(0,1) random numbers, and

places these 50 numbers into the first 50 elements

of the variable Y.

2.1} input

output

2.2) input

output

2.3) input

output

variable

;

parameter

;

variable

;

variable

function ; parameter or variable

;

An example of sub-category 2.1 is the SUM

operation ; if Y is a variable, then

LET A = SUM Y

computes the sum of all the elements in the

variable Y, and places that sum into the parameter

An example of sub-category 2.2 is the CUMULATIVE

SUM operation ; if Y is a variable, then

LET Y2 = CUMULATIVE SUM Y

computes the cumulative sum (= partial sum) of the

elements in the variable Y, and places the

resulting cumulative sums into corresponding

elements of the variable Y2; thus

Y2(l) = Y(l)

Y2(2) = Y(l)

Y2(3) = Yd)

etc.

Y(2)

Y(2) + Y(3)

An example of sub-category 2.3 is

operation ; if F is a function, then

the ROOTS

LET Y = ROOTS F WRT X FOR X = 0 TO 10

determines all of the roots of the function X in

the interval 0 to 10 and places those roots (if

any found) into the elements of Y. If no roots

are found, then Y3 will not be formed; if 1 root

is found, then Y3 will be a parameter; if 2 or more roots are found, then Y3 will be a variable.

If the analyst enters

LET Y = NORMAL RANDOM NUMBERS FOR I = 101 1

then this instructs DATAPLOT to generate enougl

random numbers so as to fill

element 101

at increments of 1 up to element 200

of the variable Y (that is, elements 101, 102,

103, 104, 198, 199, 200 of the variable Y);

total of 100 random numbers are generated

.

If the analyst enters

LET Y = NORMAL RANDOM NUMBERS FOR I = 101 2

r then this instructs DATAPLOT to generate enoug

random numbers so as to fill

element 101 at increments of 10 up to element 200

of the variable Y (that is, elements 101, 111,

121, 131, 181, 191, of the variable Y);

total of 10 random numbers are generated.

Random numbers may be generated for

distributions and distributional families. No\

the distinction between a distribution and I distributional family. A distribution has only

prototype shape for the probability densi

function ; this probability density function may

displaced or may be squeezed/expanded due

different location/scale parameters, b\

nevertheless , there is only one prototype sha, for this function. Examples of distributions ar\

Normal (= Gaussian)

Uniform

Logistic

Double Exponential (= LaPlace)

Cauchy

Semi-Circular

Triangular

Lognormal

Halfnormal

Exponential

Extreme Value Type 1
3-11

On the other hand, a distributional family

represents not just 1 distribution, but rather a set of distributions . Each different distribution

has its own prototype probability density function

which changes depending on the value of the

shape/tail length parameter for the family.

Examples of distributional families are

Tukey lambda

t (= Student 's t)

Chi-squared

F

Gamma

Beta Weibull

Extreme Value Type 2 Pareto

The shape/tail length parameters which need to be

defined for the various distributions are

Tukey lambda LAMBDA

t ( = Student 's t)

Chi-squared

F

NU

NU

NU1 AND NU2

Gamma

Beta Weibull

Extreme Value Type 2 Pareto

GAMMA

ALPHA AND BETA

GAMMA

GAMMA

GAMMA

Binomial

Geometr ic

Poisson

Negative Binomial

N AND P

PLAMBDA

K AND P

Binomial

Geometric

Poisson

Negative Binomial

When generating random numbers from a distribution , such as

LET Y = NORMAL RANDOM NUMBERS FOR I = 1 1 50

then the one command line is sufficient . On the

other hand, when generating random numbers from a member of a distributional family, then an additional command line is needed so as to specify

what member of the family the random numbers are

being drawn from. For example, to generate random

^numbers from the t distribution , the entry

J LET Y = T RANDOM NUMBERS FOR 1=1 1 50

Ijwould be incomplete because we have not specified

which member of the t family is desired. To rectify this, we precede the above statement with

:an additional statement which defines the desired

NU value, as in

As an aside, note that DATAPLOT allows probability

plots to be generated for the same extensive set of distributions and distributional families as enumerated above for random numbers. For

distributions , only a single command is needed, as

in

NORMAL PROBABILITY PLOT Y

which generates a normal probability plot of the

data in the variable Y; but for distributional

families, an additional command is needed to specify the desired member of the family, as in

LET NU = 20 T PROBABILITY PLOT Y

which generates a t probability plot (with NU = 20) of the data in Y.

For category 4 (Miscellaneous )

, the input

depends on the operation , but the output is a variable. For example,

LET Y = SEQUENCE 70 .1 80

LET NU = 5 LET Y = T RANDOM NUMBERS FOR I 1 1 50

LET NU = 20 LET Y = T RANDOM NUMBERS FOR I = 1 1 50

generates a sequence of numbers

starting with 70 at increments of .1 and stopping with 80.

A total of 101 numbers are generated— 70, 70.1,

70.2, 70.3, 79.8, 79.9, 80. These 101 values

are placed in the first 101 elements of the

variable Y.

I
3-12

Built-in Library Functions

LET, LET FUNCTION, PLOT, 3D-PLOT , FIT, and PRE-FIT

General FORTRAN-like expressions are allowable in

the LET, LET FUNCTION, PLOT, 3D-PLOT, FIT, and

PRE-FIT commands . These expressions may

include any general FORTRAN-like combination

of +, *, /, and ** operations , as well

as any mixture of the following built-in

library functions . In all of the following

expressions, the X, Y, etc. in the arguments may

be DATAPLOT parameters, variables , or functions

.

Examples of usage of such functions are

LET Y = EXP(-X)/(2+6*X)

which if X is a variable (parameter) will form a corresponding variable ( parameter ) as given by the

function expression.

LET FUNCTION F = LOG( 2*X ) / ( EXP( SQRT(X) )

)

defines a function F as given by the expression

.

PLOT SQRT( 1-0 .5*X**2 ) FOR X = 0 .1 1

The trigonometric functions are much more

extensive than the usual FORTRAN library. The

DATAPLOT library includes all circular functions

,

all inverse circular functions , all hyperbolic

functions , and all inverse hyperbolic functions

.

The probability functions include cumulative

distribution functions , probability density

functions, and percent point functions (= inverse

cumulative distribution functions) for 4 common distributions/distributional families , namely—

Normal

tChi-squared

F

Such functions are useful for hypothesis testing.

generates a plot of the function at the points 0, at increments of .1, and stopping at 1 (that is, at the points 0, .1, .2, . .., .8, .9, 1).

3D-PL0T EXP(-X**2-Y**2) FOR X = -2 .2 2 FOR Y = -2 .2 2

generates a 3-dimensional plot of the bivariate

surface as given by the function and evaluated at

the X points -2, at increments of .2, and stopping

at 2; and at the Y points -2, at increments of .2,

and stopping at 2. The plot will be a cross-hatched surface. The analyst should have

previously entered (via the EYE COORDINATES

command) the position of the analyst's eye in

viewing the surface, as in EYE COORDINATES 10 11 5.

FIT Y = EXP ( -ALPHA *X) / (A+B*X)

carries out a non-linear fit according to the

function.

PRE-FIT Y = LOG(A+B*X) FOR A = 1 1 10 FOR B = 1 .12

carries out a pre-fit according to the function,

with the pre-fit carried out over the lattice of

points specified by A = 1, 2, 3, 9, 10 and B

= 2, 1.2, 1.2, 1.8, 2.9, 2.

The built-in library functions include

1) General Functions;

2) Trigonometric Functions;

3) Probability Functions.

The general mathematical functions include various

FORTRAN-library entries, plus Chebychev, Bessel,

octal-decimal conversions , etc.
3-13

General Functions—

ascription Function Example

bsolute value ABS(X) LET Z = A + B*EXP(ABS(X) + C) quare root SQRT(X) LET z = A + B*EXP(SQRT(X) * C)

xponential EXP(X) LET z = A + B*EXP(EXP(X) + C)

ogarithm (natural) LN(X) LET z = A •f B*EXP(LN(X) + C)

ogarithm (natural

)

LOG(X) LET z = A + B*EXP(LOG(X) + C)

ogarithm (base 10) LOGIO(X) LET z = A B*EXP( LOG10(X ) * C)

ogarithm (base 2) LOG2(X) LET z = A + B*EXP(L002(X) + C)

ign SIGN(X) LET z = A + B*EXP(5IGN(X) + C)

nteger portion INT(X) LET z = A + B*EXP(INT(X) + C)

ractional portion FRACT(X) LET z A + B *EXP ( FRACT (X ) + C )

l odulo MOD(X,Y) LET z = A B*EXP(MOD(X,Y ) + C)

inimum HIN(X,Y) LET z = A + B*EXP(MIN(X ,Y) + C)

'^aximum MAX(X,Y) LET z A + B*EXP(MAX(X,Y) + C)

iositive difference— x-min( x,y

)

DIM(X,Y) LET z A B*EXP(DIM(X,Y) + C)

ctal to decimal conversion OCTDEC(X) LET z A + B*EXP(OCTDEC(X) + C

ecimal to octal conversion DECOCT(X) LET z A + B*EXP(DECOCT(X) + C

irror function ERF(X) LET z A + B*EXP(ERF(X) + C)

omplementary error function ERFC(X) LET z A + B*EXP(ERFC(X) + C)

amma function GAMMA (X) LET Z A + B*EXP( GAMMA!X ) + C)

og (to the base e) Gamma function LOGGAMMA(X) LET z A B*EXP( LOGGAMMA (X) +

hebychev polynomial of the first kind and order 0 CHEBO(X) LET z A * B*EXP(CBEBO(X) + C)

hebychev polynomial of the first kind and order 1 CHEBl(X) LET z A + B*EXP(CBEB1(X) + C)

[hebychev polynomial of the first kind and order 2 CHEB2(X) LET z A + B*EXP(CHEB2(X) + C)

[hebychev polynomial of the first kind and order 3 CBEB3(X) LET z A + B*BXP(CHEB3(X) + C)

hebychev polynomial of the first kind and order 4 CBEB4(X) LET z A + B*EXP(CBEB4(X) * C)

hebychev polynomial of the first kind and order 5 CBEB5(X) LET z A + B*EXP(CHEB5(X ) * C)

hebychev polynomial of the first kind and order 6 CBEB6(X) LET z A * B*EXP(CHEB6(X) + C)

hebychev polynomial of the first kind and order 7 CHEB7(X) LET z A + B*EXP(CBEB7(X) * C)

hebychev polynomial of the first kind and order 8 CBEB8(X) LET z A + B*EXP(CBEB8(X) + C)

hebychev polynomial of the first kind and order 9 CBEB9(X) LET z A + B*EXP(CBEB9(X) * C)

hebychev polynomial of the first kind and order 10 CHEBIO(X) LET z A + B*EXP(CEEB10(X) + C

\essel function of the first kind and order 0 BESSO(X) LET z A + B*EXP(BESSO(X) + C)

essel function of the first kind and order 1 BESSl(X) LET z A + B*EXP(BES51(X) + C)
3-14

Trigonometric Functions—

Descr ipti on Function Example

Sine SIN(X) LET Z = A + Cosi ne COS(X) LET z = A + Tangent TAN(X) LET z = A Cotangent COT(X) LET z = A

Secant SEC(X) LET z = A Cosecan

t

CSC(X) LET z = A

Arcsine ARCSIN(X) LET z = A + Arccosine ARCCOS(X) LET z = A + Arctangent ARCTAN(X) LET z = A + Arccotangent ARCCOT(X) LET z = A

Arcsecant ARCSEC(X) LET z = A * Arccosecant ARCCSC(X) LET z = A *

Hyperbolic Sine SINH(X) LET z = A Hyperbolic Cosine COSH(X) LET z = A + Hyperbolic Tangent TANH(X) LET z = A Hyperbolic Cotangent COTB(X) LET z = A Hyperbolic Secant SECH(X) LET z = A Hyperbolic Cosecant CSCH(X) LET z = A +

Hyperbolic Arcsine ARCSINH(X) LET z = A + Hyperbolic Arccosine ARCCOSH(X) LET z = A Hyperbolic Arctangent ARCTANH(X) LET z = A + Hyperbolic Arccotangent ARCCOTH(X) LET z = A Hyperbolic Arcsecant ARCSECH(X) LET z = A + Hyperbolic Arccosecant ARCCSCH(X) LET z = A +

B*EXP(SIN(X) + C)

B*EXP(COS(X) + C)

B*EXP(TAN(X) + C)

B*EXP(COT(X ) * C)

B*EXP(SEC(X) * C)

B*EXP(CSC(X) * C)

B*EXP(ARCSIN(X) + C)

B*EXP(ARCCOS(X) + C)

B*EXP(ARCTAN(X) + C)

B*EXP(ARCCOT(X) + C)

B*EXP(ARCSEC(X) + C)

B*EXP(ARCCSC(X) * C)

B*EXP(SINH(X) + C)

B*EXP(COSH(X) + C)

B*EXP(TANH(X) + C)

B*EXP(COTH(X) * C)

B*EXP(SECH(X) + C)

B*EXP(CSCH(X) + C)

B*EXP(ARCSINH(X ) + C, B*EXP(ARCCOSH(X) + C, B *EXP(ARCTANHfX ) + C, B*EXP(ARCCOTH(X) + C, B*EXP(ARCSECH(X) + C. B*EXP(ARCCSCH(X) + C.

Probability Functions—

Description

Normal N(0,1) cumulative distribution function

t cumulative distribution function

Chi-squared cumulative distribution function

F cumulative distribution function

Normal N(0,1) probability density function

t probability density function

Chi-squared probability density function F probability density function

Normal N(0,1) percent point function

t percent point function

Chi-squared percent point function

F percent point function

Function

NORCDF(X)

TCDF{X,NV)

CHSCDF(X,NV)

FCDF(X,NV1,NV2

)

NORPDF(X)

TPDF(X,NV)

CHSPDF(X,NU)

FPDF(X,NV1,NV2)

NORPPF(X)

TPPF(X,NU)

CHSPPF(X,NV)

FPPF(X,NV1,NV2)

Example

LET Z = A * B*EXP(NORCDF(X) + C; LET Z = A + B*EXP(TCDF(X) + C) LET Z = A + B*EXP(CHSCDF(X ) + C LET Z = A * B*EXP(FCDF(X) + C)

LET Z = A + B*EXP(NORPDF(X) * C LET Z = A * B*EXP(TPDF(X) + C) LET Z = A * B*EXP(CBSPDF(X) + C LET Z = A + B*EXP(FPDF(X) * C)

LET Z = A * B*EXP(NORPPF(X) * C LET Z = A + B*EXP(TPPP(X) * C) LET Z = A + B*EXP(CHSPPF(X) * C LET Z = A + B*EXP(FPPF(X) * C)
3 -15

Creating Parameters, Copying Parameters,

Variables, and Functions Variables, and Functions

LET, LET FUNCTION, LET

READ, and SERIAL READ

A parameter is a named scalar and may be defined

via the LET command, as in

LET A = 17.26 LET B = 3.97 LET C = -5.38 LET D = 2 .4*10**(-8

)

LET E = B**2-4*A*C

LET F = MEAN X

A variable is a named vector (a named

single-dimension array), and may be defined via

the LET, READ, and SERIAL READ commands, as in

LET Y = SEQUENCE 1 1 10 LET Z = PATTERN 12 3 FOR 1=119

LET U = NORMAL RANDOM NUMBERS FOR I = 1 1 100

LET X2 = X**2-LOG(Y

)

LET Y2 = SQRT( X+Y**3

)

or

READ X Y

1 1 2 4

3 9

45 16

25 END OF DATA

SERIAL READ X Y 1124394 16 5 25

END OF DATA

Copying parameters, variables, and functions is

just a special case of more general operations

involving the creation of parameters, variables,

and functions.

Parameters

in

may be copied via the LET command, as

LET B = A LET C = A

If A in the above examples is a parameter , then B and C will become parameters with the same value

as A.

Variables may be copied with the LET command, as

in

LET Y = X

LET Z = X

If X in the above examples is a variable, then Y and Z will become variables with the same values

as X.

Functions may be copied via the LET FUNCTION

command, as in

LET FUNCTION G = F LET FUNCTION H = F

If F in the above examples is a function, then G

and H will become functions with the same character string as F.

A function is a named character string, and may be

defined via the LET FUNCTION command, as in

LET FUNCTION F = EXP( -0 . 5 *X**2

)

LET FUNCTION G = SIN( 2*PI*W*T

)

LET FUNCTION H = F+LOG(G) LET FUNCTION F2 = DERIVATIVE F WRT X

Functions may be concatenated and built-up

piece-by- piece, as in

w,

LET FUNCTION NUM = EXPI -ALPHA *X

)

LET FUNCTION DENOM = A+B*X

LET FUNCTION RATIO = NUM/DENOM

hich is equivalent to

LET FUNCTION RATIO = EXP( -ALPHA*X ) / ( A+B*X

)

I
3-16

Deleting Parameters, Variables, and Functions

DELETE

The DELETE command will cause parameters

,

variables , and functions to be deleted. The form

for the delete command is

DELETE list of parameters, variables,

and/or function names

Thus, to delete parameters A and B, variables X and Y, and functions F and G, one could enter

DELETE A DELETE B DELETE X DELETE Y DELETE F DELETE G

or simply

DELETE A B X Y F G

Note that the DELETE command may be used in

conjunction with SUBSET/EXCEPT/FOR qualifications

to accomplish a partial or selected delete of

elements within variables (partial deleting of

parameters and functions may not be done).

Whenever a partial delete of a variable is done,

then the undeleted elements in the variable are automatically "packed" into the first available

elements of the variable. For example,

DELETE X Y SUBSET LAB 4

would delete all elements in X and Y corresponding

to LAB 4 (and pack all remaining elements of X and

Y). Note that X and Y would end up with the same number of elements , but the LAB variable would be

unchanged and so would be longer and "out of

alignment" with the new X and Y. To circumvent

this, one could have entered

Immediately after the deletion is done, the

remaining elements in the variable are packed. To delete successive elements in the same variable,

the analyst should delete the higher elements

first and then proceed to the lower elements

.

Thus to delete elements 2, 7, and 15 of variable

X, one should enter

DELETE X(15) X(7j X( 2

)

which is equivalent to

DELETE X(15)

DELETE X( 7

)

DELETE X(2)

rather than

DELETE X(2) X(7) X( 15

)

which is equivalent to

DELETE X( 2

)

DELETE X(7)

DELETE X(15)

Because of the successive packing after each

deletion , the latter code would not yield the

desired results— the former code should be used

(Note that one need not heed this caution when one

uses the SUBSET/EXCEPT/FOR qualification for

deleting elements).

A practical example of when the deletion of

specific elements would be useful is when the

analyst has a variable Y, and suspects (perhaps

via a lag-1 plot) that the i-th element of Y was related to the (i-l)st element of Y, in such

fashion that a first-order autoregressive model

would be appropriate . To carry this out one could

enter

DELETE X Y LAB SUBSET LAB 4

which would carry out the delete, and result in

the variables X, Y, and LAB all having the same

(shortened ) length. The DELETE may be used with

any general SUBSET/EXCEPT/FOR qualification. In particular

,

DELETE X Y FOR I = 1 1 20

would delete elements 1 through 20 of variables X

and Y. The net result is that element 21 would

shift up and become element 1, element 22 would

become element 2, etc.

Specific elements of a variable may be deleted by

explicit referencing of the element; for example,

DELETE X(4) Y(10) Z(30)

which would delete the 4-th element of X, the

10-th element of Y, and the 30-th element of Z.

LET Yl = Y LET N = NUMBER Y DELETE Yl(l)

DELETE Y(N)

FIT Y = AO-hAl*Yl

The above code would

1) Copy Y into Yl (the elements of Y remain unaffected);

2) Determine the number of elements in Y (place this into the parameter N);

3) Delete the first element of Yl (and shift all remaining elements up 1);

note that Yl now has N-l elements;

4) Delete the last element of Y

(so that Y also has N-l elements);

5) Carry out a least squares linear fit of

Y on Yl; thus yielding a firstorder autoregressive fit.
Partial deletion of variables may also be done via

the RETAIN command. The form is the same, but the

RETAIN command will retain only those elements

specified , and delete all others. As with the

DELETE command, the remaining elements are

'packed* into the first available elements after

the deletion is done. Thus

RETAIN X Y FOR I = 10 1 20

would delete all elements in X and Y except those

from 10 to 20. These 11 elements would then be

shifted up to become elements 1 to 11 of the new, shortened variables X and Y. The new length of X

and Y would be 11.
3-18

Assigning Multiple Names to a Variable

NAME

The NAME command allows the analyst to attach more

than 1 name to a variable. For example, suppose a variable X existed, to attach an additional name

(X2, say) to X, one would enter

NAME X2 X

The net effect is that the name X2 would be

attached to the name X, and either of the 2 names

could be used at any time after that to refer to the same variable . Note that

NAME X2 X

is different than

LET X2 = X

The latter would in fact create a second variable

X2 and fill it with values of the variable X. This second variable X2 is distinct from X (and

takes up additional space in the internal DATAPLOT

data storage area).

One may use the NAME command to attach as many

different names as desired to an existing

variable. To check what names are currently

attached to a variable, the analyst should enter

the STATUS command.

Renaming variables is not commonly done but does

have application when used in conjunction with

subprograms. Suppose, for example, that one has

constructed a general subprogram that is residing

in a file ANALYSIS , and which is written in

general terms so as to operate on variables Y and

X, such as

PLOT Y X

SUMMARY Y FIT Y = A+B*X

CHARACTER X BLANK

LINES BLANK SOLID

PLOT Y PRED VERSUS X

PLOT RES X

How can one use this subprogram if the variables

in the main program are called something other

than X and Y? This is done via the NAME command,

for example,

READ DAYl. PRES1 VOLl

NAME X PRES1

NAME Y VOLl

TITLE CALIBRATION 1 CALL ANALYSIS.

READ DAY2. PRES2 V0L2

NAME X PRES2

NAME Y V0L2

TITLE CALIBRATION 2 CALL ANALYSIS.

READ DAY3. PRES3 V0L3

NAME X PRES3

NAME Y V0L3

TITLE CALIBRATION 3 CALL ANALYSIS.

The above code would

1) read data from file DAYl

into the variables PRES1 and VOLl;

2) assign the additional name X to PRES1;

3) assign the additional name Y to VOLl;

4) specify the title (of future plots) to be

CALIBRATION 1

5) invoke the subprogram residing in file

ANALYSIS so as to carry out an analysis

;

6) read data from file DAY2

into the variables PRES2 and V0L2

;

7) assign the additional name X to PRES2

;

8) assign the additional name Y to V0L2;

9) specify the title (of future plots) to be CALIBRATION 2

10) invoke the subprogram residing in file

ANALYSIS so as to carry out an analysis

;

11) read data from file DAY

3

into the variables PRES3 and V0L3;

12) assign the additional name X to PRES3;

13) assign the additional name Y to V0L3;

14) specify the title (of future plots) to 2>< CALIBRATION 3

15) invoke the subprogram residing in file

ANALYSIS so as to carry out an analysis

.
3-19

Creating Data Internally

LET, READ, and SERIAL READ

'he most common way to create data in DATAPLOT is

o simply read it in via the READ and SERIAL READ

ommands. Such data is usually read from an xternal mass storage file. Occasions arise, owever , where it is convenient to create data

nternal to a DATAPLOT program. For example, in

arrying out a spline fit, it is required to pecify a variable containing the knot positions

'he LET command may be used directly to create

laments of a variable . For example,

LET X(l) = 20 LET X( 2 ) = 55 LET X(3) = 23.66

ill result in the first element of the variable X

eing set to the value 20, the second element of

he variable X being set to 55, and the third

lement of the variable X being set to 23.66.

ther related forms for this use of the LET

ommand are shown in the following program--

LET A = 23 LET X( 4 ) = A LET X(5) = X(2)

LET X(6) = A+SQRT( 2.4) LET J = 7 LET K = 3 LET X(J) = Y(K)

'he above code will

1) define a parameter A with the value 23;

2) set the fourth element of the variable X

equal to A (which currently has value

23);

3) set the fifth element of the variable X

to the same value as the second element

of the variable X;

4) set the sixth element of the variable X

equal to A+SQRT(2.4) —note that A has the

value 23;

5) set the parameter J = 7;

6) set the parameter K - 3;

7) set the J-th element of the variable X to

the same value as the K-th element of the

variable Y— note that J and K currently

have the values 7 and 3, respectively

3te that if an element appears on the right side

the assignment statement, it must not be

rt of an arithmentic expression; thus

LET A = X( 2

)

LET B = X(5)

LET X(10) = A + B**2

are legal , but

LET X(10) = X( 2 ) + X(5)**2

will result in an error message.

The SEQUENCE sub-form of the LET command allows

the analyst to create a variable consisting of a sequence of numbers. The general form is

LET variable = name SEQUENCE start

value

increment stop

value

LET X = SEQUENCE 1 1 10

which would result in the creation of a variable X with the 10 values—1, 2, 9, 10. The command

LET Y = SEQUENCE 0 .1 20

creates the variable Y with 201 values—0, .1, .2,

19.9, 20.

LET Z = SEQUENCE 10 - . 1 -10

creates the variable Z with 201 values—10, 9.9,

9.8, -9.9, -10.

LET START = 1 LET INC = .01 LET STOP = 2 LET U = SEQUENCE START INC STOP

creates the parameters START, INC, and STOP, and

then creates the variable U with 101 values—1,

1.01, 1.02, 1.99, 2.

The PATTERN sub-form of the LET command allows the

analyst to create a variable consisting of a pattern of numbers. The general form is

LET variable = name

as m

PATTERN sequence of values

LET X = PATTERN 123456789 10

which would result in the creation of a variable X

with the 10 values—1, 2, 9, 10. The command

LET Y = PATTERN 12 3

creates the variable Y with 3 values—1, 2, and 3.

LET Z = PATTERN 111222333
3-20

creates the variable Z with 9 values—1, 1, 1, 2,

2, 2, 3, 3, and 3. To repeat patterns , one simply

augments the PATTERN sub-form with a FOR

qualification ; for example,

LET X = PATTERN 12 3 FOR 1=1 1 12

creates a variable X with 12 values— 1, 2, 3, 1,

2, 3, 1, 2, 3, 1, 2, 3.

LET Z = PATTERN 111222333 FOR I = 1 1 18

creates a variable Z with 18 values—1, 1, 1, 2,

2, 2, 3, 3, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3. The use of the PATTERN command arises in connection with

forming a variable (if not already available) for

defining individual traces in a multi-trace plot,

and in defining a variable for carrying out ANOVA

and graphical ANOVA.

To generate random numbers internally , the analyst

uses the RANDOM NUMBERS subform of the LET

command. The general form is

The final 2 ways to create data internally in a DATAPLOT program involve the use of READ and

SERIAL READ commands. If one excludes the

specification of a mass storage file/subfile, then

the data may be specified immediately in the

program as in

READ X

20

5523.66

END OF DATA

SERIAL READ X

20 55 23.66

END OF DATA

Both of the above will create a variable X with

the 3 values—20, 55, and 23.66.

LET variable = distribution RANDOM NUMBERS FOR I = start increment stop

name name value value

The distribution name identifies the distribution

from which random numbers are to be drawn. The

FOR qualification at the end of the command tells

DATAPLOT into which elements of the variable the

random numbers are to be placed. Thus

LET X = NORMAL RANDOM NUMBERS FOR 1=1 1 100

will generate 100 normal random numbers and place

them into elements 1 to 100 of variable X.

LET X = NORMAL RANDOM NUMBERS FOR I = 1 2 50

LET X = CAUCHY RANDOM NUMBERS FOR I = 2 2 50

will generate 25 normal random numbers and place

them into elements 1, 3, 5, 49 of variable X,

and then generate 25 Cauchy random numbers and

place them into elements 2, 4, 6, 48, 50 of

variable X. To specify particular members of a distributional family, specify the distributional

parameter value prior to use of the RANDOM NUMBER

sub-form, as in

LET NU = 5 LET X = T RANDOM NUMBERS FOR I = 1 1 30

which will generate 30 random numbers from the t distribution with nu = 5 degrees of freedom.

LET GAMMA =2.57

LET X = WEIBULL RANDOM NUMBERS FOR 1=11 200

will generate 200 random numbers from the Weibull

distribution with gamma = 2.57.
4-1

Fi les and Subf i les

The DATAPLOT commands which

file/subfile specifications are—

may contain

READ read data from a file;

SERIAL READ read sequential data from a file;

WRITE write data out to a file;

CREATE dynamically create a subprogram;

CALL execute a subprogram;

SAVE save all internal DATAPLOT settings;

RESTORE restore all internal DATAPLOT settings,

The DATAPLOT convention in designating files and

subfiles is as follows—

1) qualifier ; 2) qualifier- file separator (an asterisk)

3) file name;

4) file name-subfile name separator (a period);

5) subfile name.

\The qualifier is typically a user identifier , a project identifier , or simply an extended file

name. The qualifier allows the computer to distinguish between 2 files which nominally have

'the same name. For example, if analyst SMITH has

a file called DATA, and analyst JONES has a file

called DATA, then to distinguish between these 2 files called DATA, the analyst may be required to enter SMITH*DATA or JONES*DATA , respectively , as

READ SMITH*DATA. X Y

The file name is up to 12 characters . The period

at the end of the file name tells DATAPLOT that

the file name is finished and the subfile name (if

existent) is starting. The period must be

appended to all file names in all relevant

DATAPLOT commands regardless of whether the system

allows subfiles or not. The period is important

because it tells DATAPLOT that the entry is a file name as opposed to a variable name. For example,

in the READ command, if DATAPLOT encounters

READ A. B C

then it expects to read from file A and to read

the first 2 numbers on each line image of file A into variables B and C. On the other hand, if

DATAPLOT encounters

READ ABC

then the absence of a file name is a signal to DATAPLOT that the data will be read in from the

terminal where the first 3 numbers on each line

image will be placed into the variables A, B, and

C, as in

READ ABC

111

2 4 8

3 9 27

4 16 64

END OF DATA

READ JONES*DATA. X Y

Qualifier names may be up to 12 characters . On

some computer systems, the qualifier name is

optional; on others, it is required. If optional,

and if omitted, then the computer system usually

substitutes a default qualifier name that was

defined by the user at the time of log-on. For

example, on some computers, analyst SMITH may be

able to enter

READ DATA. X Y

s a shorter form of

READ SMITH*DATA. X Y

The qualifier separator tells DATAPLOT that the

qualifier name is finished , and the file name is

starting. The separator is typically 1 character

•in length. At NBS, the separator character is * (an asterisk) . Other computers juy choose to some

other separator besides *. For example, on VAX

systems, the separator is usually 1.

Even though such ambiguity does not exist in other

commands , such as

SAVE DATA.

(which will allow all internal DATAPLOT switch

settings to be saved to the file DATA because the

DATAPLOT run has to be interrupted for some reason) the DATAPLOT convention (for consistency '

sake) is to have all file names appended with a period in all commands ; thus

SAVE DATA,

is correct, while

SAVE DATA

is incorrect.

Some computer systems allow subfile

structure—that is, allow files to be logically

subdivided into smaller units which may be treated

as logical entities unto themself . For example,

UNIVAC systems allow such subfiles , while some computers may not allow subfiles . If the computer

system allows subfile structure , then DATAPLOT

allows such names to be up to 12 characters , as in
4-2

READ DATA. CALIBRATION? X Y

which would instruct DATAPLOT to read from subfile

CALIBRATION? of file DATA, and to read the first 2 values on each line image into variables X and Y.

The above allowances (12 characters for

qualifiers , 12 characters for file names, and 12

characters for subfile names) are DATAPLOT

allowances ; these limits may be overridden by

restrictions on name length imposed by the

computer system itself (for example, some may allow only 8 characters for names). The user should check with local system personnel to determine if such restrictions exist.
4-3

Input/Output

DATAPLOT input/output is carried out via the

following 3 commands—

READ

SERIAL READ

WRITE

All reading and writing is format- free . There are

no format statements in DATAPLOT.

The READ and SERIAL READ have 4 auxiliary commands

which may at times be of use to the analyst

in reading data into DATAPLOT—

SKIP

ROW LIMITS

COLUMN LIMITS

END OF DATA

I
4-4

Reading in Columns of Data

READ

The most common method of inputting data into

DATAPLOT is via the READ command. The general

form for the READ command is

READ file name, (optional

)

list of variable

names

In the following examples, data will be read from

the terminal (as part of the program) —

READ X

READ X Y READ X Y Z READ Yl Y2 Y3 Y4 Y5 Y6 X READ RESPONSE TEMP VOLUME PRESSURE LAB

In the following examples , data will be read from

file A. (the period at the end of the file name

(A. as opposed to A) is important —it tells

DATAPLOT that A is a file and not a variable)

.

The period at the end of the file name is used in

the NBS implementation —other implementations may

have other punctuation to indicate a file (for

example, a slash /). Some punctuation must be

used, however, in order for DATAPLOT to distinguish file names from variable names. Check the local DATAPLOT service organization for

file indicators at your installation.

READ X Y

1 14

916

25 END OF DATA

Note that in this case, the read will continue

until a line image is encountered which has the

END OF DATA command.

If that same data set were to be read from a A., then the command would befile

READ A. X Y

where the file A.

6 line images —

would consist of the following

14

91625 END OF DATA

or equivalently the following 5 lines--

READ A. X 11

READ A. X Y 2 4 READ A. X Y Z 3 9 READ A. Yl Y2 Y3 Y4 Y5 Y6 X 4 16 READ A. RESPONSE TEMP VOLUME PRESSURE LAB 5 25

The input data file must be an editable file. In particular , such a file may not be a binary file

that would (for example) result from a FORTRAN

program which uses a formatless write, as in

WRITE ( 7 ) ( X ( I ) ,Y( I ) ,1=1,1000)

Such a FORTRAN write statement results in a packed, binary output file which is efficiently

generated , but nevertheless uneditable . Such a file may not serve as input into DATAPLOT

.

Some computers allow subfile structures. Thus in

the following examples , data will be read from

subfile B of file A—

READ A.B X READ A.B X Y READ A.B X Y Z READ A.B Yl Y2 Y3 Y4 Y5 Y6 X

READ A.B RESPONSE TEMP VOLUME PRESSURE LAB

A specific example of reading data in from the

terminal itself (or the program itself) is as follows —

The reason that the above 2 file structures are equivalent is the DATAPLOT convention that the

read from a file (or subfile) will continue until

1 ) an END OF DATA line image is encountered;

2) an end of file is encountered ;

(whichever comes first). The 6-lin

representation of the data in the file A. i actually redundant (the END OF DATA line image is superfluous ) but no harm was done and the result

of the read will be the same in both cases. DATAPLOT input is format-free. Numbers on a lin

should be separated by at least one space.

Missing values on a data file should be convertec

(e.g., by a local editor) into some numeric valut

(e.g., -9999) which may subsequently be easili

'weeded out" (via SUBSET and EXCEPT qualifications

after being read into DATAPLOT, as in

READ A.B X Y DELETE X Y SUBSET X < -9000

DELETE X Y SUBSET Y < 9000

FIT Y = A+B*EXP(-C*X)

PLOT Y PRED VERSUS X

PLOT RES X
4-5

If there are more variables specified in the READ

statement than there are data values on the line

j image, as in

READ X Y Z U 111

2 4 8 3 9 27

END OF DATA

then an error message will be generated . If there

are fewer variables specified than there are data

values, as in

READ X Y 111

2 4 8

3 9 27

END OF DATA

then only as many data values per line image will

be read as there are variables specified (2 in

this case), and remaining data values on each line

image will be ignored. Thus in thr example, the

variable X will end up with values 1 2, and 3; and the variable Y will end up with the values 1,

4, and 9. The values 1, 8, and 27 will be

i gnored

Data may be in usual floating point

representation, as in

1.234

-23.6489

26.00054

or exponential format, as in

1.234+4

1.234E+4

Note that the E format is permitted for data

on a file/subfile (because such a file is commonly

the output from a previously-run FORTRAN

program)

(On the other hand, it is recalled that E format

is not permitted in any form of the LET command;

thus LET A = 1.234E+4 is illegal).

The READ command will generate a feedback message

indicating the first line image that was read, the

last line image that was read, the number of line

images read, and the number of variables read.

Reading from multiple data files may be

out. Suppose file A. consisted of

images—

1112

13

1415

and file B. consisted of 3 line images—

carried

5 line

2122

23

then what will be the effect of the following 2 statements —

READ A. X

READ B. X

The first READ will fill the first 5 locations of

X with 11 to 15. The second READ will fill the

with 21 to 23. The net

that the variable X

5 observations —

first 3 locations of X

effect after both reads is

will contain the following

2122

23

1415

The rule is that all READs always start at the top

of a variable unless otherwise directed . This

allows variables to be partially overwritten which

may (at times) be what the analyst intended

However, the more usual case is that the analyst

would like to have data from various files

concatenated one behind the other. This may be

done by use of SUBSET/EXCEPT/FOR qualifications

attached onto the end of the READ statment. For example,

Trailing zeros and the decimal point in integers

may be omitted, as in

1.0

1.

1

Note the following features of reading data into

DATAPLOT—

1) data on succeeding line images do not have

to be neatly lined up one under the other—

the read is free-format

2) the analyst does not need to be concerned

with pre-specifying the number of line

images—the READ will continue until

an END OF DATA statement is encountered or

until an end of file is encountered.

READ A. X

READ B. X FOR 1=618

will have what effect? The first READ will (as

before) fill the first 5 locations of X with 11 through 15. The second READ tells DATAPLOT to read from file B., but to place the read values

internally in the variable X starting with

location 6, at increments of 1, up to location 8 —

thus the 3 data values will be read into locations

6, 7, and 8 of variable X. After both reads, the

variable X will contain the following 8 observations —
4-6

1112

13

14 15

2122

23

With the FOR qualification, we can direct data

anywhere we like within a variable (or variables )

.

It is a valuable tool for data entry.

The SUBSET/EXCEPT qualifications on the end of the

READ statement behave similarly . They work with

variables that have already been defined ( via

READ, LET, etc.). For example, suppose the

analyst already had a variable called LAB which

has 15 values (say) —

12

12

12

12

12

12

12

1

What would be the effect of the following

statement?

READ A. X SUBSET LAB 1

The effect is that the 5 data values (11 through

15) of file A. would be read in, but these data

values would not be placed into the first 5 locations of variable X, rather, they would be

placed in the first available locations as defined

in the SUBSET qualification (SUBSET LAB 1). Since

the internal variable LAB has value 1 for

locations 1, 3, 5, 7, 9, 11, 13, and 15, then the

net effect is that the 5 data values that were

read in would be placed in locations 1, 3, 5, 7, and 9 of variable X. What would be in locations

2, 4, 6, etc.? These locations will remain

unaffected by the READ, and so they will contain

whatever values they had before the READ. (Note

that all values in DATAPLOT's internal data area have a default sign-on value of negative machine

infinity . ) Much more complicated SUBSET/EXCEPT/FOR

constructs may be formed, although in practice

these complicated constructs are rarely

needed—especially for input.
4-7

Reading Data in Sequentially

SERIAL READ

All of the comments and conventions for the READ

command also hold for the SERIAL READ command

except for the following important difference—

whereas the READ command only reads a fixed number

of data values per line image, the SERIAL READ

allows the analyst to read all the data values on

a line image. The motivation for this is that some analysts prefer to place data on a file/subfile in a serial fashion (multiple values

of a variable on each line image), as opposed to

the more common parallel fashion (only 1 value of

each variable on each line image). To amplify the

difference between READ and SERIAL READ, consider

the following—

Suppose the file A. consisted of the following 4

I line images—

11 12 13 14 15 16

21 22 23 24

31 32

41 42

I The command

READ A. X

would result in X having 4 values—11, 21, 31, and

Si 41. The command

SERIAL READ A. X

would result in X having 14 values—11, 12, 13,

14, 15, 16, 21, 22, 23, 24, 31, 32, 41, and 42.

Further, if instead of reading 1 variable we had

read 2 variables , as in

READ A. X Y

then X would have 4 values—11, 21, 31, and 41;

j and Y would have 4 values—12, 22, 32, and 42;

but the command

w

SERIAL READ A. X Y

would result in X having 7 values—11, 13, 15, 21,

23, 31, and 41; and Y having 7 values—12, 14,

! 16, 22, 24, 32, and 42.

j And if instead, we had read in 3 variables , as in

READ A. X Y Z

then this would have resulted in an error message

because lines 3 and 4 contains no Z value;

whereas , the command

SERIAL READ A. X Y Z

j

would result in variable X having 5 values—11,

14, 21, 24, and 41; variable Y having 5 values—12, 15, 22, 31, and 42; and variable Z having 4 values —13, 16, 23, and 32.

i
4-8

Reading in Parameters

READ PARAMETER

The READ PARAMETER command allows the analyst to read in one or more parameters. The READ

PARAMETER command will cause exactly one line

image to be read and scanned. Thus

READ PARAMETER ZZZ. A B C

will cause the next line image of the file ZZZ to be read and scanned, and the first 3 numbers on

this line image will be placed into the DATAPLOT

parameters A, B, and C. If more than 3 numbers

exist on the line, then the remaining numbers will

be ignored. If less than 3 numbers exist on the

line, then as many parameters as numbers will be

formed and the remaining parameters will be

i gnored.

If no file name is entered, as in

READ PARAMETER ABC

then the next line image from the terminal (or

program) will be used, and so

READ PARAMETER ABC

11 12 13

will result in creating 3 internal parameters A,

B, C, and assigning the value 11 to parameter A,

the value 12 to parameter B, and the value 13 to parameter C.

Note that only the next single line is scanned for

parameters. This convention was imposed for

simplicity , and is no constraint in practice

because the analyst may enter multiple READ

PARAMETER statements if multiple lines of

parameters exist . Thus

READ PARAMETER ZZZ. ABC

READ PARAMETER ZZZ. D E F G H

with the next 2 lines of file ZZZ. consisting of

23.6 -55 212

3400 26.97 85.88 0.0056 10

will result in the prescribed 8 parameters being

properly defined.
4-9

Reading in Functions

READ FUNCTION

The READ FUNCTION command allows the analyst to read in a function. The READ FUNCTION command

will cause exactly one line image to be read

and scanned. Thus

READ FUNCTION ZZZ. F

will cause the next line image of the file ZZZ to

be read and scanned, and the text on that line to

be placed into the DATAPLOT function F. Leading

and internal blanks are preserved , but trailing

blanks are ignored.

If no file name is entered, as in

READ FUNCTION F

then the next line image from the terminal (or

program) will be used, and so

READ FUNCTION F EXP(-X**2)

will result in the internal function F being

created which has the 10-character contents

,EXP(-X**2 )

Note that only 1 function may be read at a time,

i and only 1 line is scanned for such a function

Such conventions were imposed for simplicity , and

they hardly serve as any constraint on the analyst

since functions may be freely concatenated inside

DATAPLOT via the LET FUNCTION command. Thus

READ FUNCTION ZZZ. F READ FUNCTION ZZZ. G

LET FUNCTION H = F+G

with the next 2 lines of file ZZZ. consisting of

EXP(-X**2)

SIN(X)/SQRT(LOG(X)

)

will result in function F being defined as

EXP(-X**2)

the function G being defined as

SIN(X)/SQRT(LOG(X)

)

and the function H being defined as

EXP(-X**2)+SIN(X)/SQRT(LOG(X)

)
4-10

Writing Out Parameters, Variables, and Functions

WRITE

The WRITE command may be used to write out parameters , variables , or functions . The general

form for the WRITE command is

which would

WRITE file/subfile name (optional

)

To write information back to the terminal, one

omits the file/subfile name and just enters the

list of parameter/variable/function names to be

printed, as in

WRITE X

WRITE A B WRITE ABC

WRITE X Y Z U WRITE Y X G PRED RES REPSD REPDF

The list of names may be in arbitrary

order—parameter names, variable names, and

function names may be mixed at will. To write to

a file, one enters the file name immediately after

WRITE, as in

WRITE A. X

WRITE A. A B WRITE A. A B C WRITE A. X Y Z U WRITE A. Y X G PRED RES REPSD REPDF

which would write out the designated

parameter/variable/function names to file A. The

period following the file name A. is

important —it is that punctuation which tells

DATAPLOT that A. is a file name as opposed to a parameter/variable/function name. The period at the end of the file name is the convention used

with the NBS implementation—check locally for

what the punctuation is that defines the end of a file name at your implementation. The WRITE

command may also be used to write out strings,

comments, and headings. The general form for this

purpose is

WRITE "string to be written out"

1) read in data;

2) erase the screen;

list of names 3 ) print out the line STRONTIUM ANALYSIS

4) carry out a non-linear fit;

5) copy the screen contents to hardcopy.

The WRITE command may be used with a SUBSET/EXCEPT/FOR qualification to write out interesting subsets of the data. For example, if X

and Y were variables

,

WRITE X Y

would write out all values of X and Y; but

WRITE X Y FOR I = 11 1 20

would write out only elements 11 to 20 of variables X and Y; while

WRITE X Y SUBSET LAB 4

would write out only those elements of X and Y foi which the LAB variable has the value 4; and

WRITE X Y SUBSBT Y > 100

would write out all values of X and Y for which

> 100 (which is useful for listing those dat,

lines corresponding to outliers ) . Any genera

complicated SUBSET/EXCEPT/FOR qualification may h

appended to the WRITE statement.

as m

WRITE "LABORATORY 4 ANALYSIS"

which would print the line

LABORATORY 4 ANALYSIS

on the next available line. This is useful for

headings as in

READ A. X Y ERASE

WRITE "STRONTIUM ANALYSIS"

FIT Y = A+B/(C+X)

COPY
4-11

Skipping Over

Lines in a Read

SKIP

Restricting a Read

to Certain Rows

ROW LIMITS

The SKIP command sets an internal switch which

indicates how many lines should be skipped in a file/subfile before the reading of data. The

default setting is 0 (= no lines to be skipped).

To change the setting, enter

SKIP number

where the number indicates the desired number of

lines at the beginning of the file which are to be

skipped over ( = ignored) for any subsequent reads

i (via READ, SERIAL READ, or READ FUNCTION). This

command is usually used to skip over heading and

other non-numeric information at the beginning of

a data file. Thus if the file A. consisted of

the following 6 lines—

CALIBRATION STUDY

LABORATORY A

11

21

31END OF DATA

[and if one entered

SKIP 1 READ A. X

.,then an error message would result (because no

^numeric information is on line 2. If one entered

SKIP 2 READ A. X

then the variable X would end up with the 3 values

•11 , 21 , and 31 . If one entered

SKIP 3 READ A. X

then the variable X would end up with only 2 values— 21 and 31.

Vote that as with

settings , once the

all underlying DATAPLOT

SKIP setting is made, it

remains in effect for the duration of the run, or

until overridden by another SKIP command.

The SKIP command allows one to skip over lines at the beginning of a file. The ROW LIMITS command

is similar but it gives the analyst the ability to ignore lines at both the beginning and the end of

a file. The general form for the command is

ROM LIMITS number number

where the first number is the first line number of

the data file to be read, and the second number is

the last number of the data file to be read. The

default values for the row limits switch are 1 and

infinity. Thus if the file A. consisted of

1121

31

41

51

and if one entered

ROW LIMITS 2 4 READ A. X

then the variable X would end up with

21, 31, and 41.

values—

The ROW LIMITS command adds a third rule to the list of those governing when a READ will stop;

the 3 rules are

1) if an END OF DATA line is encountered;

2) if an end of file is encountered;

3) if the row limits maximum is encountered.
4-12

Restricting a Read

to Certain Columns

COLUMN LIMITS

Terminating a Read

END OF DATA

The COLUMN LIMITS command allows the analyst to focus on a certain region within a line image.

The general form for the command is

COLUMN LIMITS number number

where the column numbers indicate the start and

stop columns for the data image scan. Thus if the

data file consists of the following 3 lines

The usual termination for a READ, SERIAL READ, or READ FUNCTION command is when a line image is

encountered which has

END OF DATA

or

END DATA

11 12 13

21 22 23

31 32 33

where the first number on each line starts in

column 1, the next number on each line starts in

column 11, and the third number on each line

starts in column 21, then

COLUMN LIMITS 10 15

READ X

would result in the variable X having 3 values—

12, 22, and 32.

on it. This is true regardless of whether or not

the END OF DATA line image is in the data file

(which is the usual practice) or is in the program

itself, as in

READ X

1121

31END OF DATA

If the analyst is reading from a data

file/subfile, then the usual procedure is for the

analyst to append an extra line image to the

file/subfile consisting of

END OF DATA

via the local editor.

In addition to an END OF DATA line image being

encountered , there are 2 other ways in which a read may be terminated—

1) when the end of the file or subfile being

read is encountered ;

2) when the pre-specified row limits maximum

has been attained

.

These last 2 procedures may be used without using

an END OF DATA statement.

The general rule of thumb is, therefore , that a READ or SERIAL READ will continue processing data

from a file until one of the following 3 conditions is met —

1) an END OF DATA line image is encountered

;

2) an end of file or subfile is reached;

3) a row limits maximum is attained.

The read will terminate as soon as any one of

these 3 conditions is satisfied

.
5-1

Loop ing

LOOP

Most DATAPLOT programs do not need loops. In .FORTRAN [for example) the use of loops is commonly

j used for intermediate calculations en route to the

final output. In DATAPLOT, however, the existence

of numerous high-level graphics and analysis

commands frequently obviates the need for such

intermediate looping.

To initiate a loop in DATAPLOT, use the LOOP

command. The general syntax is

Note that

LOOP FOR parameter name

start value

increment

The loop parameter will be a parameter in the

usual DATAPLOT sense. As the loop is being

executed , the parameter value will be successively

changed (depending on start, increment, and stop

values). The

END OF LOOP

END LOOP

commands will terminate the loop. This parameter

value is global and may be used by any calculation

or specification within the loop. Thus

LOOP FOR I = 1 1 10

i WRITE I END OF LOOP

will result in the sequence 1, 2, 3, 9, 10

-.being printed out.

LOOP FOR L = 1 1 5

^ PLOT Y X SUBSET LAB L END OF LOOP

fowill result in 5 distinct plots being generated—

1) a plot of Y versus X but restricted to those values for which the LAB variable = 1;

2) a plot of Y versus X but restricted to those values for which the LAB variable = 2;

3) a plot of Y versus X but restricted to those values for which the LAB variable =3;

4) a plot of Y versus X but restricted to those values for which the LAB variable = 4;

5) a plot of Y versus X but restricted to those values for which the LAB variable = 5.

LOOP FOR D = 1 1 10

FIT Y = A+B*X SUBSET DAY D

LET A2(D) = A LET B2(D) = fl LET S(D) = RESSD

END OF LOOP

Stop

value

will carry out 10 linear fits of Y on X—each fit

being restr icted to values of the DAY variable = to 1, then 2, then 3, etc. Further, for each fit,

the value of the fit parameter A will be copied

into the D-th element of variable A2 , the value of

the fit parameter B will be copied into the D-th

element of the variable B2 , and the value of the

fit residual standard deviation parameter RESSD

(automatically provided by DATAPLOT) will be

copied into the D-th element of the variable S.

FEEDBACK OFF

ERASE

LOOP FOR 1X1 = 10 10 80

LET IY1=1X1

LET 1X2=1X1+10

LET IY2=IX2

BOX 1X1 IY1 1X2 IY2

END OF LOOP

will generate a sequence of boxes along the lower

left to upper right diagonal of the screen.

As is usual, the start value, increment, and stop

value may be either numbers or parameters . Thus

LOOP FOR L = 1 1 5 PLOT Y X SUBSET LAB L END OF LOOP

and

LET A = 1 LET B = 1 LET C = 5 LOOP FOR L = A B C

PLOT Y X SUBSET LAB L END OF LOOP

are equivalent.

If one does use parameters for specifying the

loop, then these parameters may be altered

within the loop—this capability is at times used in conjunction with the IF

qualification of the LET command so as to prematurely terminate a loop when a certain

condition is arrived at. For example,
5-2

LET ALPHAMAX = 10

LOOP FOR ALPHA = .1 .1 ALPHAMAX

LET INT = INTEGRAL X**ALPHA WRT X FOR X LET ALPHAMAX = -INFINITY IF INT < .05 END OF LOOP

0 TO 1

will terminate itself as soon as a value of ALPHA

is arrived at in which the integral of X**ALPHA

(over the domain 0 to 1) is less than .05.

The checking of the loop parameters is done at the

begin*>2r.? the loop. It is possible for a loop

not to be executed at all (if the increment is

positive and the stop value is smaller than the

start value; or if the increment is negative and

the stop value is larger than the start value);

thus

LET STOP = -1 LOOP FOR A = I 1 STOP

PRINT A END OF LOOP

would result in the loop not being executed

.

Loops may be nested 7 deep. Thus to generate

plots of Y versus X for each combination of

variables OP (with 3 levels), LAB (with 5 levels),

and DAY (5 levels), one could enter

LOOP FOR 0=113

LOOP FOR L = 1 1 4 LOOP FOR D = 1 1 5 PLOT Y X SUBSET OP 0 SUBSET LAB L SUBSET DAY D

END OF LOOP

END OF LOOP

END OF LOOP

HARDCOPY

SEQUENCE

LOOP FOR 0

LOOP FOR L LOOP FOR D XLABEL OPERATOR = VALU( )0

X2LABEL LAB = VALUf )L

X3LABEL DAY = VALUf )D

PLOT Y X SUBSET OP 0 SUBSET LAB L SU3SET DAY END OF LOOP

END OF LOOP

END OF LOOP

Any valid DATAPLOT command can be executed within

the context of a loop. A particularly important

command is the CALL command which allows a subprogram to be referenced . Thus for more complicated applications , it may be of interest to set up a loop in the main program and then specify

a desired set of operations in a subprogram , as in

LOOP FOR 0 = LOOP FOR L = LOOP FOR D = CALL A. END OF LOOP

END OF LOOP

END OF LOOP

where subprogram A might consist of

XLABEL OPERATOR = VALUf )0

X2LABEL LAB = VALUf )L

X3LABEL DAY = VALUf )D

PLOT Y X SUBSET OP 0 SUBSET LAB L SUBSET DA'

To have the 60 plots automatically hardcopied as they are being generated , and to have them

automatically numbered (1 to 60), one could enter

HARDCOPY

SEQUENCE

LOOP FOR 0 = LOOP FOR L = LOOP FOR D = 1 1 5 PLOT Y X SUBSET OP

END OF LOOP

END OF LOOP

END OF LOOP

0 SUBSET LAB L SUBSET DAY D

To have them hardcopied , sequenced, and also to have them properly labeled with the current

operator, lab, and day value, one could use the

VALUf ) sub-command in conjunction with the

...LABEL command, as follows—
5-3

Conditionally Executing Statements

SUBSET, EXCEPT, FOR, and IF

Conditional execution of statements is handled in

2 different ways in DATAPLOT—

1) the augmentation of SUBSET/EXCEPT/FOR

qualifications at the end of

any graphics or analysis command

(this is used when the the conditionality

is based on values within variables )

2) the use of the IF command

in conjunction with the END OF IF

(or END IF) command

(this is used when the conditionality

is based on values of parameters).

Method 1 is the most popular and is the most

straightforward way of conditionally executing

commands . It is a DATAPLOT feature that any

graphics command or any analysis command may be

[conditionally executed (that is, have its

execution restricted to a certain subset of data,

or have its execution contingent on the value of

certain variables ) by simply appending the

qualification to the end of the command line. As

Yfar as the analyst is concerned , the primary

general objective is to generate a plot, carry out

la fit, carry out an analysis of variance, etc.,

whereas the restriction of such an activity to a specific subset is, in a sense, an afterthought

\This being the case, the DATAPLOT structure is to have the DATAPLOT command (PLOT, FIT, ANOVA, etc.)

appear first and foremost on the line, and then

to simply append the qualification to the end of

\the line. Thus it is easy and natural to extend

I PLOT Y X

FIT Y = A+B*LOG(X)

ANOVA Y XI X2 X3

to

PLOT Y X SUBSET LAB 4 FIT Y = A+B*LOG(X) SUBSET X . ANOVA Y XI X2 FOR I = 1 1 40

50 EXCEPT X = 140

pile specified subset is extracted before the

command is executed . If the subset is empty, then

the command will not be executed

Method 2 is a much less popular way of

conditionally executing statements , but does have

occasional application. To conditionally execute

a "chunk' of DATAPLOT code, one may use the IF

command in combination with the END OF IF (or END

IF) command. The general form for the IF command

lis

IF parameter or number

relative

operator

parameter or number

equality

inequali ty

less than

< less than or equal to

greater than

=> greater than or equal to

The conditionality specification is done in terms of parameter values (as opposed to variable values

in the SUBSET/EXCEPT qualification ) . For example,

suppose a variable X has 100 values in it and it

is desired to determine the maximum value in X. The easiest way to do this in DATAPLOT is to simply enter

LET MAX = MAXIMUM X

However, for purposes of illustration of the use of the IF command, one could achieve the same

result via the following statements—

LET MAX = -INFINITY

LOOP FOR 1=11 100

LET XI=X(I)

IF XI > MAX

LET MAX = X(I)

END OF IF

END OF LOOP

It is clear that the second method is an extremely

inefficient method for computing the parameter

MAX.

As a second example, suppose it is desired tc determine that combination of A and B (over a specified lattice of values) for which the Ll fit

of A+LOG(B+X) is achieved. The easiest way to carry this out in DATAPLOT is

FIT POWER 1 PRE-FIT A+LOG(B+X) FOR A = 1 1 10 FOR B = 100 10 200

At the end of the PRE-FIT, the optimal values will

reside in the parameters A and B. An alternate

(and much longer) way of doing the same is

vhere the relational operators are
LET MIN = INFINITY

LOOP FOR A = 1 1 10

LOOP FOR B = 100 10 200

LET PRED = A+LOG(B+X)

LET RES = Y-PRED LET RES2 = ABS(RES)

LET SUMA1 = SUM RES2

IF SUMAD < MIN

LET A2 - A LET B2 = B END OF IF

END OF LOOP

END OF LOOP

At the end of execution of this code, the optimal

values of A and B will reside in the parameters A2

and B2.

IF statements may be nested up to 7 deep, as in

IF A > 10 IF B = 7 IF C < = 100

WRITE ABC

END OF IF END OF IF END OF IF

The parameters A, B, and C will be scanned; only

if the 3 specified conditions are satisfied will

the WRITE occur.

Any valid DATAPLOT statment may occur within the

context of the IF set of statements. A particularly powerful entry is the CALL statement

which allows subprograms to be executed

.

Thus, for example, to conditionally execute

(only if the residuals standard deviation RESSD

from some fit is less than .1) a subprogram XYZ

,

one could enter

IF RESSD < .1 CALL XYZ. END OF IF

The END OF IF may optionally be written as END IF,

thus the above code may also be written as

IF RESSD C .1 CALL XYZ. END IF

The IF capability in DATAPLOT is a low-level

capability (no one does IF as an end objective in

itself). Conditionally executing a chunk of code

is an elementary capability of any computer

language. In DATAPLOT, due to the existence of

high-level capabilities, and due to the

SUBSET/EXCEPT/FOR qualification capability, the IF

capability is only lightly used.
5-5

Calling Subprograms

CALL

The typical DATAPLOT program consists only of a \main program. The existence of higher-level

capabilities (e.g., PLOT, FIT, LET, etc.) often

i precludes complicated nesting of subprograms.

However, subprograms may be included in DATAPLOT

las needed.

'^Subprograms are completely independent programs in

their own right and must be placed in separate

mass storage files (or subfiles ) . Such

subprograms are accessed via the CALL command and

tare identified by the name of the mass storage

file (or subfile) in which the subprogram resides,

as in

CALL XYZ.

(which would execute the subprogram residing in

file XYZ), or

CALL XYZ. ABC

(which would execute the subprogram residing in

the subfile ABC of the file XYZ). As with all

DATAPLOT commands which involve file/subfile

usage, the trailing period after the file name is

important —it tells DATAPLOT that the name is a file name. Further, for those computer systems

which allow logical subfiles within files, the

period also serves as a separator between file

name and subfile name.

When the last line of the subprogram in the file

is executed , it returns to the main program to the

statement immediately following the CALL

statement. The name of the subprogram is taken to be the name of the file where the subprogram

resides. Modularity is strictly adhered to in

that only 1 subprogram may exist in any given

file/subfile. There is no necessity for internal

identification of the subprogram (e.g., there

lis (as would be the case in FORTRAN, BASIC,

and ALGOL) no need for a SUBPROGRAM, SUBROUTINE,

'or PROCEDURE statement as the first line of the

subprogram) . Nor is there any need to terminate the various subprograms with a terminator statement (e.g., RETURN). In fact,

the existence of EXIT (or END, STOP, HALT, or BYE)

will cause the DATAPLOT run to be terminated—thus

EXIT (and its synonyms) is usually reserved

(for the last line of the main program. All

.parameter , variable, and function names are

global —names defined in the main program may

\\be used and modified in subprograms (and vice

versa). Subprograms may in turn call other

subprograms. The maximum number of nested

subprograms is 7 (including the main program) .

! Subprograms may not be recursive—that is, a

. subprogram may not call itself.

IThe 4 most important ways in which subprogram

jsage arises is as follows—

1) Unconditional calls

2) Conditional calls

3) Unconditional loops

4) Conditional loops

For example—

1) Unconditional calls

In this case, a subprogram is called

once and only once. For example,

CALL SIGMA.

would cause subprogram SIGMA

to be unconditionally called once

and only once.

2) Conditional calls

This calls a subprogram exactly once and

only under certain conditions . For example,

IF A > 4 CALL SIGMA.

END OF IF

would cause subprogram SIGMA

to be called only if the current value

of the parameter A exceeds 4, but not

to call SIGMA otherwise

3) Unconditional loops

In this case, a subprogram is called

multiple times. For example,

LOOP FOR B = 1 1 10

CALL SIGMA.

END OF LOOP

would cause subprogram SIGMA

to be unconditionally called 10 times

(for B = 1, 2, 9, 10).

4) Conditional loops

In this case, a subprogram is called

for a number of times that depends

on calculations that occur within the

subprogram being called. For example,

LOOP FOR B = 1 1 C

CALL SIGMA. END OF LOOP

(where the parameter C is pre-defined

but may also be redefined within the

subprogram being called)

would cause subprogram SIGMA

to be called a variable number of times

depending on how C is redefined within

the loop.

As one would expect, execution of a pre-stored

main program may be initiated in an identical

fashion as one would execute a subprogram, namely

via the CALL command. Thus, for example, if the

analyst has signed onto DATAPLOT, and if a pre-stored main program resides in a file called

A, then execution of the main program could start with the entry of the statement

CALL A.
b-6

Creating Subprograms Listing Subprograms

CREATE LIST

The most common and most efficient method for

creating DATAPLOT subprograms is via the local

editor. That is, before the analyst enters

DATAPLOT, he/she enters into a file/subfile with

the local editor and creates a DATAPLOT program

and any needed DATAPLOT subprograms . There is no substitute for an excellent local editor— the

analyst is encouraged to use such an editor for

creating DATAPLOT programs and subprograms

.

One the other hand, it is at times convenient to be able to create a DATAPLOT subprogram "on the

fly" while one is executing a DATAPLOT program. A prime example of this is in the construction of

diagrammatic graphics in which one makes an interactive pass at forming the diagram, stores

the commands that were used en route, and then

executes these commands as a block in a semi -interactive mode.

If one is running DATAPLOT interactively , one may

automatically store the entered interactive

command lines into a file by use of the

CREATE

command. For example, to instruct DATAPLOT that

all subsequently keyed-in commands should be

in a file XYZ as they are being entered, the

analyst would enter

CREATE XYZ.

To terminate the creation of the file XYZ, the

analyst enters

END OF CREATE

or

END CREATE

To execute the contents of XYZ, one would enter

The LIST command may be used to list the contents

of any file or subfile. Usually such a capability

is taken advantage of when the file/subfile

contains a subprogram , but it may also be used

when the file contains data. The usual convention

about periods following the file name is followed.

Thus to list the contents of the file XYZ, one enters

LIST XYZ.

If the local computer system may have subfiles of

files, then to list subfile ABC of file XYZ, one enters

LIST XYZ. ABC

The LIST command only lists files/subfiles —it

does not execute the contents of such

files/subfiles

.

CALL XYZ.
6-1 Restricting Plots and Analyses to Subsets

SUBSET , EXCEPT, and FOR

The DATAPLOT keywords

SUBSET EXCEPT

FOR

may be appended to the end of any DATAPLOT

graphics or analysis command. They allow the analyst to specify precisely the desired subset

(any subset) which the plot/analysis should be

restricted to. The rules for using SUBSET/EXCEPT/FOR are straightforward ; we mention

them briefly here and then demonstrate them by

example. When the SUBSET qualification is used,

it is always followed by a variable name. Any

variable whatsoever may be used to define the subset —one which is used in the plot/analysis

statement, such as

PLOT Y X SUBSET X 100 TO 200 PLOT Y X SUBSET Y 10 TO 30

or one not explicitly involved in the plot/analysis statement, as in

PLOT Y X SUBSET LAB 4 TO 6 PLOT Y X SUBSET OPERATOR 3

After the variable specification , one may have one

of the following 4 syntaxes— Da single number;

2) a series of numbers

3) a number followed by TO followed by another

number

4) a relational operator ( = , o. <=, <, >=, or >)

followed by a single number.

A single number indicates that the subset is restricted to that specific value and no others,

as in

PLOT Y X SUBSET LAB 4

which will restrict the plot to values in Y and X corresponding to values in the LAB variable which

equal 4.

inclusively , as in

PLOT Y X SUBSET LAB 4 TO 9

which will restrict the plot to values of Y and X corresponding to all LAB values between 4 and 9, incl usi vely

A relational operator followed by a single number

indicates that the subset is restricted to that specific interval , as in

PLOT Y X SUBSET LAB >= 3

which will restrict the plot to values in Y and X corresponding to values in the LAB variable

greater than or equal to 3.

PLOT Y X SUBSET LAB = 3

will restrict the plot to values in Y and X corresponding to values in the LAB variable equal

to 3 (and so will have the same effect as PLOT Y X SUBSET LAB 3 as discussed earlier).

PLOT Y X SUBSET LAB < > 3

will restrict the corresponding to equal to 3.

plot to values in Y and X

values in the LAB variable not

SUBSET qualifications may be strung together in a more complicated fashion. Each individual SUBSET

specification may have any of the above 4 valid

syntaxes . The final subset will be the intersection of the individual subsets. Thus

PLOT Y X SUBSET LAB 4 SUBSET OPERATOR 7

will restrict the plot to values in Y and X

corresponding to values in the LAB variable equal

to 4 and (simultaneously) values in the OPERATOR

variable equal to 7. The use of many SUBSET

specifications strung together allows the analyst

to easily focus on any particular subset desied.

Thus

PLOT Y X SUBSET LAB 4 5 9 SUBSET OPERATOR 7 TO 14 SUBSET Y < 1000

A series of numbers indicates that the subset is

restricted to those specific values and no others,

as in

PLOT Y X SUBSET LAB 4 5 9

which will restrict the plot to values of Y and X

corresponding to LAB values of 4, 5, and 9.

A number followed by TO followed by another number

indicates that the subset is restricted to all values in the interval specified by the 2 numbers,

will restrict the plot to values in Y and X

corresponding to values in the LAB variable equal

to 4, 5, or 9, and (simultaneously) values in the OPERATOR variable equal to 7 to 14, and

(simultaneously) values in the Y variable less

than 1000.
6-2

In addition to direct subset specification via

SUBSET, there is also a need at times for the

subset to be defined via negation . DATAPLOT

handles such a need via the EXCEPT

qualification . For simplicity and consistency

,

the rules for using EXCEPT are identical to the

rules for using SUBSET; thus

PLOT Y X EXCEPT LAB 3

will restrict the plot to values in Y and X

corresponding to values in the LAB variable not

equal to 3.

To plot Y versus X for elements 10, 20, 30,

490, 500, one enters

PLOT Y X FOR I = 10 10 500

In the above example, we have used the dummy index

I; this is the most common choice for the FOR

qualification, although any name could have been

entered. The effect of using I is that this name

will become a DATAPLOT parameter . At the end of

the execution of the statement

PLOT Y X FOR I = 10 10 500

PLOT Y X EXCEPT LAB 3 4 7 EXCEPT OPERATOR 10 TO 15 EXCEPT Y > 1000

will restrict the plot to values in Y and X

corresponding to values in the LAB variable not

equal to 3 , 4 , or 7 , and (simultaneously ) values

in the OPERATOR variable not equal to 10 to 15,

and (simultaneously ) values in the Y variable not

greater than 1000.

At times the analyst may need to define subsets by

a combination of specifying what is in the subset

and what is not in the subset. DATAPLOT handles

this by allowing the analyst to freely mix SUBSET

and EXCEPT qualifications ; thus

PLOT Y X SUBSET LAB 3 TO 20 EXCEPT LAB 4

will restrict the plot to values in Y and X corresponding to values in the LAB variable from 3 to 20 with the exception of LAB 4.

PLOT Y X SUBSET LAB 3 4 7 EXCEPT OPERATOR 10 TO

will restrict the plot to values in Y and X

corresponding to values in the LAB variable equal

to 3, 4, or 7, and (simultaneously) values in the

OPERATOR variable not equal to 10 to 15, and

(simultaneously) values in the Y variable not

greater than 1000.

At times the analyst finds it convenient to specify a subset based not on the magnitudes and

values of numbers in variables but rather on

the element position in the variable. For

example, suppose the analyst wishes to PLOT Y versus X but to do so for only every other element

in the variables Y and X. How may this be

done? DATAPLOT accounts for this case via

the use of the FOR qualification. The FOR

qualification (which may be appended to any

DATAPLOT graphics/analysis command) has the

general form

FOR dummy index = start increment stop

And so to plot Y versus X for elements 1, 3, 5,

499, one enters

the parameter I will have the value 500 in it. One

may not string successive FOR qualifications

together at the end of a statement —only one FOR

qualification is permitted . One may not mix FOR

qualifications together with SUBSET and EXCEPT

qualifications

.

Note that in the above description of SUBSET,

EXCEPT, and FOR, we referred in many places to the

use of numbers, for example one form for the

SUBSET qualification is to have a number followed

by TO followed by another number, and the form for

the FOR qualification is to have a start number,

an increment number, and a stop number. Note that

all statements involving numbers are equally valid

for DATAPLOT parameters; that is, any

SUBSET/EXCEPT/FOR qualification having numbers in

it may equally well have pre-defined parameters in

EXCEPT Y > 1000

it. Although this feature is only rarely used, it

does give the analyst additional generality if

needed. For example,

LET A = 3 LET B = 7 PLOT Y X SUBSET X A B

is exactly equivalent to

PLOT Y X SUBSET X 3 7

and

LET START = 5 LET INCREMENT = 5 LET STOP =300

PLOT Y X FOR I = START INCREMENT STOP

is exactly equivalent to

PLOT Y X FOR 1=55 300

PLOT Y X FOR 1=12 500
6-3

As mentioned earlier, one may use any variable as

the subset variable ; occasions arise in which it

makes good sense to use one of the variables in

the plot (e.g., X or Y) as a subset variable, thus

PLOT Y X SUBSET X > 100

will restrict the plot to values in Y and X

corresponding to values in the X variable greater

than 100; while

PLOT Y X SUBSET Y < 1000

! will restrict the plot to values in Y and X

corresponding to values in the Y variable less

than 1000 (which, for example, may be of use in

regenerating a plot with outliers removed).

In addition to the variables that the analyst has

created, the subset specification variable may

also be the automatically-generated variables PRED

(= predicted values) and RES (= residuals ) which

result from any DATAPLOT fitting, spline fitting,

smoothing, Anova, Median polish, etc. operation

Note how the use of the RES variable as the subset

variable may be a valuable tool for the data

analyst in carrying out residual analysis. For

example, suppose that the analyst has carried out

, a fit , say, via

FIT Y = A+B*EXP( -C*X)

, and suppose the analyst has generated

'

t the usual superimposed plot of raw data and

. predicted values via

CHARACTERS X BLANK

LINES BLANK SOLID

PLOT Y PRED VERSUS X

and suppose further that the analyst has generated

I the usual residual plot via

PLOT RES X

Now suppose that the analyst is

interested in generating a listing of X, Y, PRED,

and RES values for all the data; this is easily

done via

PRINT X Y PRED RES

Now finally suppose that the analyst noted on the

residual plot that there was a patch of residuals

which were larger than others ( this was the region

of poorest fit) and suppose the analyst was interested in printing out those X, Y, PRED, and

RES values only for this region of poor fit. Such

a listing would be of use in exactly specifying

| the X values which had the poorest fit. For sake

of definiteness , suppose the analyst was

I interested in such a printing for all values

corresponding to residuals in excess of 10 units.

Bow may such a printing be generated? Very

easily, namely by entering

PRINT X Y PRED RES SUBSET RES > 10

A final note to this section reinforces the fact

that SUBSET/EXCEPT/FOR qualifications may be used

with any graphics/analysis command. Of particular

importance are the various forms of the PLOT

command. We have already seen how

PLOT Y X

may be restricted to become

PLOT Y X SUBSET LAB 4 TO 8

Note also that the powerful 3-argument form

PLOT Y X TAG

(which plots Y versus X but generates an individual trace for each distinct value of the

TAG variable ) may be also be restricted as in

PLOT Y X TAG SUBSET LAB 4 TO 8

Further, the same is true for the VERSUS form—

PLOT Yl Y2 Y3 Y4 Y5 Y6 VERSUS X

(which is handy for generating multi-trace plots)

may be similarly restricted , as in

PLOT Yl Y2 Y3 Y4 Y5 Y6 VERSUS X SUBSET LAB 4 TO 8

The DATAPLOT convention for subset extraction is a flexible, powerful , time-saving tool for the

scientist/researcher . Its use allows the analyst

to easily probe into interesting subsets of the

data —so as to detect anomalous behavior in such

subsets and so as to determine if conclusions and

models which hold for the full set are equally

valid for the individual subsets.
In-line Text

TITLE, ...LABEL,

Sub-commands

LEGEND, and TEXT

The entries in this section are not commands in

themselves ; rather, they are sub-commands which

may appear in-line in the text-oriented DATAPLOT

commands—TITLE, ...LABEL, LEGEND, and TEXT. The

sub-commands are "flagged" for DATAPLOT by

the existence of open and closed parentheses

following each sub-command , as in

TEXT ALPHf J BETA ( )GAMM(

)

which would write out the Greek characters alpha,

beta, and gamma. The most important of these

sub-commands are LC , UC , SUB, SUP, INTE, VALU

,

and the Greek alphabet

.

The sub-commands in this section are not

applicable for the Tektronix font, but are applicable for all of the 7 "fancy script" fonts.

Thus before use of any of the in-line text sub-commands , the analyst should inform DATAPLOT

(via the FONT command) that the default Tektronix

font is being overridden and another font is being

used, as in

FONT TRIPLEX

TEXT ALPH( )BETA ( )GAMM(

)

The VALU sub-command is especially important. It allows the analyst to substitute parameter values

in titles, labels, legends, and text strings. For example,

LET LAB = 7 TEXT ANALYSIS FOR LABORATORY VALU ( ) LAB

would result in the following line appearing--

ANALYSIS FOR LABORATORY 7

The VALU( ) sub-command will print out the value of

the parameter which immediately follows the ( ) of

VALU(). In the example above, this parameter was

LAB; this parameter had a value of 7.
6-5

General Operations

Sub-command Description Exampl

UCCAP

CAPS

LC

upper case

upper case

upper case

lower case

TEXT UC( )ABC TEXT CAP( ) ABC

TEXT CAPS ()ABC

TEXT LC( )ABC

SUB

UNSB

SUP

UNSP

subscript

un-subscript

superscript

un-superscri pt

TEXT ABCSUBf )DEF TEXT ABCSUBf )DEFUNSB( )GHI TEXT ABCSUPf JDEF TEXT ABCSUPf )DEFUNSP( )GHI

VALU substitute value of parameter TEXT VALU( )A

Greek Characters

Sub-command Description Example

ALPH alpha TEXT ALPH(

)

BETA beta TEXT BETA(

j

GAMM gamma TEXT GAMMf

)

DELT del ta TEXT DELT(

)

EPSI epsilon TEXT EPSI( ZETA zeta TEXT ZETAf

)

ETA eta TEXT ETA(

)

THET theta TEXT THET(

)

IOTA iota TEXT IOTA(

)

KAPP kappa TEXT KAPP (

LAMB lambda TEXT LAMB (

MU mu TEXT MU(

)

NU nu TEXT NU(

)

XI xi TEXT XI(

)

OMIC omicon TEXT OMIC(

)

PI Pi TEXT PI(

)

RHO rho TEXT RHO(

)

SIGH sigma TEXT SIGM(

)

TAU tau TEXT TAU(

)

UPSI upsilon TEXT UPSK ) PHI phi TEXT PHI(

)

CHI chi TEXT CHI(

PSI psi TEXT PSI(

OMEG omega TEXT OMEG (
Mathematical Symbols

Sub-command Description Example

PART partial derivative TEXT PART(

)

INTE integral TEXT INTE(

CINT circular integral TEXT CINT(

)

SUMM summation TEXT SUMM(

PROD product TEXT PROD(

)

INFI infinity TEXT INFI(

+ - + or - TEXT >-()

-+ - or + TEXT -+()

TIME times TEXT TIME(

)

DOTP dot product TEXT DOTP(

)

DEL vector product TEXT DEL(

)

DIVI division TEXT DIVI(

)

LT less than TEXT LT(

)

GT greater than TEXT GT(

)

LTEQ less than or equal to TEXT LTEQ(

)

GTEQ greater than or equal to TEXT GTEQi ) NOT= not equal TEXT NOT=(

)

APPR approximately equal to TEXT APPR(

)

EQVI equivalence TEXT EQUI( VARI varies TEXT VARI(

TILD tilde TEXT TILD(

CARA carat TEXT CARA(

PRIM prime TEXT PRIM(

RADI radical TEXT RADIf

LRAD large radiacal TEXT LRADf

)

SUBS subset TEXT SUBS(

)

SUPE superset TEXT SUPEf

)

UNIO union TEXT UNIO( INTR intersection TEXT INTR(

)

ELEM is an element of TEXT ELEM(

)

THEX there exists TEXT THEX(

)

THFO therefore TEXT THFO(
6-7

Miscellaneous Symbols

d 1 1 h— r~, /

r

^i mm 3 n Descri pti on Exampl

SPAC opace 1 dA 1 -D LriK^ I / SP Space TFXT ) LAPO left apostrophe TEXT LAPO(

)

RAPO right apostrophe TEXT RAPO(

)

LBRA -L C L l_. UZ. d O AC L* TFXT T.BPAf ) RBRA t* 7 nhi t~ hi t~ .p c]ce*h TFXT PRRAf )

7 A ^"t- /"» ])T* T 11 —l /— y-J i. fcrX C Cuiiy OLdCKGL.

r ight curly bracfcet i dA 1 t\K*Bi\ [ / LELB 1 Pft" how TFXT T,FT.R( ) RELB X X yi J l_ CrX UkJYi 1 dA 1 t\CitjD\ J r i rth\ +- a n /- x X y/J L aOCc/i C 1 CtA 1 [ J LACC 1 (*fi~ accent' TEXT LACC(

)

BREV TEXT BREVf

)

RQUO right. guote TEXT RQUO(

)

xtri l y uulc TFXT TJlllOf )

/j<3 sp rppyir A72CD^ ) IASP inverted nasp I tX 1 IAjPI I RARR right arrow TEXT RARR(

)

LARR left arrow TEXT LARRf

)

UARR up arrow TEXT UARRf

)

DARR down arrow TEXT DARR(

)

PARA para graph TEXT PARA(

)

DAGG da gger TEXT DAGG (

)

DDAG double dagger TEXT DDAG(

)

VBAR vertical bar TEXT VBARl

)

DVBA double vertical bar TEXT DVBA(

)

LVBA long vertical bar TEXT LVBA(

)

HBAR horizontal bar TEXT HBAR(

)

LHBA long horizontal bar TEXT LHBA(

)

BAR bar TEXT BAR(

)
6-8

Defaults, Restrictions, and Settings

Plot Control —

Operation

Automatic pre-erase (before plots) Automatic bell (before plots) Automatic hardcopy (after plots) Automatic sequence numbers on plots

Default

ononoff

off

Command

PRB-BRASB

BELL HARDCOPY SEQUENCE

Plot characters

Line types

Title and labels Maximum number of characters in title Maximum number of characters (each label)

all blank

all solid

all blank

100

100

CHARACTERS

LIXBS

TITLE and . .LABEL

Plot scale

Grid lines Axis limits

linear ...LOG off . . .GRID neat —float with data ...LIMITS

Frame lines Frame corner coordinates

Tic marks

Tic mark labels

Tic mark position

all 4 appear

(15,20) and (85,85) on all 4 frames

on all 4 frames

through frame

. . .FRAME FRAME CORNER COORDINATES

. . .TICS ...TIC LABELS

...TIC POSITION

Legends Maximum number of legends Maximum number of characters (all legends)all blank

100

500

LEGEND

Arrows Maximum number of arrows

Line segments Maximum number of line segments

Boxes Maximum number of boxes

all off

100

all off

100

all off

100

ARROW . .

.

SEGMENT ...

BOX ...

Font (for all titles, labels, legends, etc.) Tektronix FONT

Size for plot characters

Size for plot lines Size for plot tics Size for plot titles Size for plot lables Size for plot legends

3X screen height)

3X screen height)

3X screen height)

3X screen height)

3% screen height)

3% screen height)

CHARACTER SIZE

LINE SIZE

TIC SIZE

TITLE SIZE

. . .LABEL SIZE

LEGEND ... SIZE

Color for plot characters

Color for plot lines Color for plot frames

Color for plot tics Color for plot tic labels

Color for plot titles Color for plot lables Color for plot legends

Color for plot arrows

Color for plot segments

Color for plot boxes Color for background f« inside frame line) Color for margin (* outside frame line)

red red

red

red red

red

red red

red

red red

blue

blue

CHARACTER COLOR LINE COLOR FRAME COLOR

TIC COLOR

TIC LABEL COLOR TITLE COLOR

...LABEL COLOR LEGEND ... COLOR ARROW . . . COLOR SEGMENT ... COLOR BOX ... COLOR BACKGROUND COLOR MARGIN COLOR

3d origin

where xO

yOzO

3d frame lines

3d eye coordinates

where xe

yere

3d pedestal color for 3d pedestal

min mln

min

max

max

data

data

data

3*(max x 3*(max y 3*(max z

- min x)

- min y)

- mln x)

(xO,yO,eO)

on

(xe,ye,ze)

off

red

ORIGIN COORDINATES

FRAME

EYE COORDINATES

PEDESTAL

PEDESTAL COLOR

Maximum number of plot points per plot Maximum number of superimposed plots

1000 no limit
(,-')

Diagrammatic Graphics—

Operation

Font Case Justification

Height

Width Color of Background

Color of text and figures

Default Command

Tektronix

upper case

left- justified

3 (= 3% screen height)

2 (= 2% screen width)

bl ue red

PONT CASE

JUSTIFICATION

HEIGHT

WIDTH BACKGROUND COLOR LINE COLOR

Output Devices—

Operation Default Command

Terminal Horizontal picture points

Vertical Picture points

Output device # 1 Terminal color status

Terminal continuity status Maximum number of output devices Status of device 1 Status of devices 2 to 5 Status of penplotter

Status of hardcopy unit

Tektronix 4014

1024

781 terminal off ( = non-color

)

on

5onoff

off

off

TERMINAL MANUFACTURER

PICTURE POINTS PICTURE POINTS

COLOR CONTINUOUS

ZETA, CALCOMP, VERSATEC PENPLOTTER HARDCOPY

Operation Default Command

Maximum number of variables Maximum number of observations per variable Maximum total internal data storage

Automatically-provided variables Automatically provided parameters Maximum number of variable/parameter/function names (total) Maximum number of characters (total for all functions

)

Maximum number of characters in FIT model Maximum number of parameter names in FIT model Maximum number indpendent variables in FIT

101000 10000 PRED and RES

PI and INFINITY

200 1000

200

100

DIMENSION

DIMENSION

Support —

Operation Default Command

Trigonmetric units Baud rate

Text angle

Echo

Bell (at time of plot)

Host Cut-off standard deviation for FIT Cut-off number of iterations for FIT

Default fit criterion power for PRB-FIT

Degree of internal calculations

Feedback messages from commands

Print output from analysis commands

Number of lines to be skipped on READ/SERIAL READ

Row limits for READ/SERIAL READ

Column limits for READ/SERIAL READ

Command terminator charactor

radi ans 1200

0 degrees ( = horiz .

)

off

onUnivac 1100 Bxec 8 0.000005

50

2 f= least squares)

single precision

onon

0

1 to Infinity

1 to 132

; or corriage return

ANGLE UNITS BAUD RATE ANGLE

ECHO

BELL HOST

FIT STANDARD DEVIATION

FIT ITERATIONS FIT POWER

FEEDBACK

PRINTING

SKIP ROW LIMITS COLUMN LIMITS

TERMINATOR CHARACTER
6-10

General —

Operation

Maximum number of characters per terminal line Maximum number of lines per command

Continuation indicator (at end of line) Command terminator indicator

80

2

or carriage return

Command

TERMINATOR CHARACTER

Machine Constants (Bxample 1 —Univac 1100/82) —

Operation Default

Standard input unit Standard output unit Number of bits per character

Number of characters per word

Number of bits per word Machine infinity

56

9

4360.1701412*

SET

SET

39

Machine Constants (Example 2 —Vax 11/780)-

Operation

Standard input unit Standard output unit Number of bits per character

Number of characters per word

Number of bits per word Machine infinity

568

432XXX

SET

SET

File/Subfile Nomenclature—

Operation

Qualifier- file separator (Example 1 —Univac 1100/82) File-subfile separator (Example 1 —Univac 1100/82)

Qualifier-file separator (Example 2—Vax 11/780) File-subfile separator (Example 2 —Vax 11/780)

File/Subfile Structure—

Default Command

Purpose

Message

News

Mail Help

Bug Query

Log

Read

Write Macro Save

Scratch

Data

Plot Plot 2

Unit Number

2122

23

2425

2f27

3132

3334

4142

4344

Name

DPMESF

DPNEWF

DPMAIF

DPHELF DPBUGF

DPQUEF DPLOGF

user-defined

user-defined

user-defi ned

user-defined

DPSCRF

DPDATE

DPPLI

F

DPPL2F

File or Subfile

file only

file only

file only

file only

file only

file only off

file or subfile

file or subfile

file or subfile

file or subfile

file only

file only

file only

file only

Command

MESSAGE

NEWS MAIL

HELP

BUG

QUERY

READ and SERIAL READ WRITE CREATE and CALL SAVE and RESTORE
6-11

Dumping Status Information

STATUS

The status of the most important internal DATAPLOT

settings may be printed out via the STATUS

command. This command has no arguments , one simply

enters

STATUS

The following is an example of the type of output

which would result from entering the STATUS

command—
6-12

* STORAGE INFORMATION * ****************************************************

* NUMBER OF ... * USED * UNUSED * MAXIMUM * ****************************************************

* VARIABLES (COLUMNS) * 6* 4

* 10 *

* OBS PER VARIABLE * 98 * 902 * 1000 It

* OBS (TOTAL) * 6000 * 4000 * 10000 * * FUNC CHAR (TOTAL) * 13 * 987 * 1000 *

* VAR/PAR/FUNC NAMES 23 * 177 * 200 * ****************************************************

SET PLOT PLOT PLOT PLOT PLOT

INDEX LINE LINE CHARACTER CHARACTER CHARACTE

TYPE COLOR TYPE COLOR SIZE

1 BLAN RED X RED 1.000

2 SOLI RED BLAN RED 1.000

3 SOLI RED X RED 1.000

4 SOLI RED X RED 1.000

5 SOLI RED X RED 1.000

6 SOLI RED X RED 1.000

7 SOLI RED X RED 1.000

8 SOLI RED X RED 1.000

9 SOLI RED X RED 1.000

10 SOLI RED X RED 1.000

X--AXIS PLOT MINIMUM = -.17014118+039

X--AXIS PLOT MAXIMUM = .17014118+039

Y -AXIS PLOT MINIMUM - -.17014118+039

Y -AXIS PLOT MAXIMUM = .17014118+039

VARIABLE 1 (WITH 98 ELEMENTS) HAS THE FOLLOWING NAMES: TIME X

VARIABLE 2 (WITH 98 ELEMENTS) HAS THE FOLLOWING NAMES: STRAIN Y

VARIABLE 3 (WITH 98 ELEMENTS) HAS THE FOLLOWING NAMES: STRESS

VARIABLE 4 (WITH 3 ELEMENTS) HAS THE FOLLOWING NAMES: STRESS

2

VARIABLE 5 (WITH 1 ELEMENTS) HAS THE FOLLOWING NAMES: S2

VARIABLE 6 (WITH 1 ELEMENTS) HAS THE FOLLOWING NAMES: C2

PARAMETER PI HAS THE FOLLOWING VALUE. .3141593+001

PARAMETER INFINITY HAS THE FOLLOWING VALUE. .1701412+039

PARAMETER NSTRESS2 HAS THE FOLLOWING VALUE. .3000000+001

PARAMETER K HAS THE FOLLOWING VALUE. .1000000+001

PARAMETER ST HAS THE FOLLOWING VALUE .3000000+003

PARAMETER A HAS THE FOLLOWING VALUE .1591170+000

PARAMETER B HAS THE FOLLOWING VALUE -.6243119-001

PARAMETER C HAS THE FOLLOWING VALUE. .1450866-002

PARAMETER REPSD HAS THE FOLLOWING VALUE .0000000

PARAMETER REPDF HAS THE FOLLOWING VALUE .0000000

PARAMETER RESSD HAS THE FOLLOWING VALUE .2687022-002

PARAMETER RESDF HAS THE FOLLOWING VALUE .3400000+002

FUNCTION G —A+B*EXP(-C*X)
6-13

The STATUS output has 3 sections—

1 ) storage;

2) plot control;

3) parameter/variable/function .

The storage section prints out information

concerning the internal DATAPLOT arrays which have

been used by the analyst. For the above

example, the storage section indicates the

following—

1) The maximum number of variables allowed

is 10 (else use the DIMENSION command);

6 variables have been defined (TIME,

STRAIN, STRESS, STRESS2, S2, and C2 )

, and

10-6 = 4 variables remain to be defined;

4) 12 parameter names (INFINITY

,

PI, NSTRESS2, K, ST, A, B, C,

REPSD, REPDF, RESSD , RESDF) ; of

these 12 parameter names, PI and INFINITY are pre-defined

by DATAPLOT and contain the

value of the mathematical

constant pi and the machine

single-precision maximum. The 4 parameters REPSD, REPDF, RESSD,

and RESDF are also

internally-computed by DATAPLOT

whenever any PRE-FIT, FIT, EXACT

RATIONAL FIT, SPLINE FIT,

SMOOTH, ANOVA, OR MEDIAN POLISH

is done— they contain the

values

2) The maximum number of observations per

variable allowable is 1000 (else use the

DIMENSION command); The longest (out of

the 6 variables ) has 98 observations

1000-98 = 902 observations remain to be

defined

3) The total internal storage capacity is

10000 observations . The used storage is

6 variables x 1000 observations per

variable = 6000 observations ; the

available storage available is 10000-6000

= 4000 observations.

4) The sum of the number of all characters

in all DATAPLOT functions may not exceed

1000. For this run, 13 characters have

been used (in the function G below);

hence 1000-13 = 987 are available for

further use by other functions

5) The sum of the number of parameter names

+ variable names + function names may not exceed 200. For this run, 23 names have

been defined—

1) 6 user-defined variable names

(TIME, STRAIN, STRESS, STRESS2

,

S2, and C2 )

2) 2 additional variable names (X

and Y) that have been equated to TIME and STRAIN, respectively by

use of the NAME command;

3) 2 DATAPLOT-provided variables

PRED (for predicted values) and

RES (for residuals ) ; these

variables are not listed in the

STATUS output because their

storage is separate from that of

the 10 variables and 10000 total

observation limit of the

analyst. PRED and RES are used

anytime a PRE-FIT, FIT, EXACT

RATIONAL FIT, SPLINE FIT,

SMOOTH, ANOVA, or MEDIAN POLISH

command is executed

1) REPSD = replication

standard deviation

2) REPDF = replication

degrees of freedom;

3) RESSD = residual

standard deviation

4) RESDF = residual

degrees of freedom;

The remaining parameters

(NSTRESS2, K, ST, A, B, and C) are user-defined parameters.

5) 1 function name (G).

The plot control section indicates information

relevant to the generation of plots. For the

example above, the STATUS output indicates —

1) The line types are all solid, except for the

first line type which is blank (that is, no line);

2) All line colors are red ( this is relevant

only if one has a color terminal);

3) The character types are all X's, except for the

second character which is blank (that is, no character )

4) All character colors are red (this is

relevant only if one has a color terminal);

5) All character sizes are 1 of total screen height);

.0 (that is, 1%

6) the x-axis minimum is set at -infinity and

the x-axis maximum is set at ^infinity ; these infinity values instruct DATAPLOT to have

the plotted horizontal axis limits be neat and

float with the data;

7) the y-axis minimum is set at -infinity and

the y-axis maximum is set at ^infinity

these infinity values instruct DATAPLOT to have

the plotted vertical axis limits be neat and

float with the data;
6-14

The parameter/variable/ function section provides

details about used parameters , variables , and

functions . For the example above--

1) variable 1 has 98 observations and may be

referred to by either the name TIME or X;

2) variable 2 has 98 observations and may be

referred to by either the name STRAIN or Y;

3) variable 3 has 98 observations and has the name STRESS;

4) variable 4 has 3 observations and has the name STRESS2;

5) variable 5 has 1 observation and has the name S2

;

6) variable 6 has 1 observation and has the name C2

;

7) parameter PI has the value 3 .141593

;

8) parameter INFINITY has the value .1701412**39;

9) parameter NSTRESS2 has the value 3;

10) parameter K has the value 1;

11) parameter ST has the value 3;

12) parameter A has the value .1591170;

13) parameter B has the value -0 .06243119;

14) parameter C has the value 0.001450866

;

15) parameter RESSD has the value 0;

16) parameter RESDF has the value 0;

17) parameter REPSD has the value 0 .002687022

;

thus the residual standard deviation from

the last fit-type operation was 0.002687022

;

18) parameter REPDF has the value 34;

thus the residual degrees of freedom from

the last fit-type operation was 34;

19) function G has the character string A+B*EXP( -C*X

)
6-15

Dumping On-Line Documentation

HELP

To print on-line documentation from within a DATAPLOT run, one uses the HELP command. The

DATAPLOT HELP command may be followed by any one

of the following 3 types of entries—

1 ) no entry at all, as in

HELP

2) a DATAPLOT Command Category entry, as in

HELP GRAPHICS

3) A DATAPLOT command name, as in

HELP PLOT

These 3 cases will now be discussed individually

If the analyst enters the HELP command alone with

no trailing entry, as in

HELP

then the following will be printed at the

terminal —

DATAPLOT IS AN INTERACTIVE GRAPHICS LANGUAGE.

THERE ARE 7 DATAPLOT COMMAND CATEGORIESHELP GRAPHICS

then the following output will appear at the

termi nal —

THE DATAPLOT GRAPHICS COMMAND CATEGORY

CONSISTS OF THE FOLLOWING 18 COMMANDS—

BOX PLOT

COMPLEX DEMODULATION . . . PLOT

. . . CONTROL CHART

. . . CORRELATION PLOT

.. FREQUENCY PLOT

. . . HISTOGRAM

. . . HOMOSCEDASTICITY PLOT

LAG . . . PLOT

.. NORMALITY PLOT

PERCENT POINT PLOT

. . . PERIODOGRAM

PIE CHART

PLOT

. . . PPCC PLOT

. . . PROBABILITY PLOT

RUN SEQUENCE PLOT

. . . SPECTRAL PLOT

3-D PLOT

GRAPHICS

ANALYSIS

DIAGRAMMATIC GRAPHICS

PLOT CONTROL

SUPPORT

OUTPUT DEVICE

KEYWORDS

FOR A LISTING OF COMMANDS WITHIN A CATEGORY, ENTER HELP FOLLOWED BY THE CATEGORY NAME,

AS IN—HELP GRAPHICS

HELP ANALYSIS

HELP PLOT CONTROL

The above is the list of the 7 general DATAPLOT

command categories —

1) Graphics

2) Analysis

3) Diagrammatic Graphics

4) Plot Control

5) Output Device

6) Support

7) Keywords

If one enters HELP followed by any of the 7 command category names, as in

HELP GRAPHICS

HELP ANALYSIS

HELP DIAGRAMMATIC GRAPHICS

then a list of all DATAPLOT command names within

that category will be printed. For example, if

one enters

FOR ADDITIONAL INFORMATION ABOUT A PARTICULAR COMMAND, ENTER HELP FOLLOWED BY THE COMMAND NAME,

AS IN—HELP BOX PLOT

HELP COMPLEX DEMODULATION . . . PLOT

HELP . . . PROBABILITY PLOT

If one enters HELP followed by a command name, as

in

HELP PLOT

HELP FIT HELP LET

then summary, usage, default, and examples

information will be printed out about that

particular command. For example, if one entered

HELP PLOT

then the following output would result—

PLOT

PURPOSE—GENERATE A PLOT

EFFECT —A PLOT IS GENERATED

VISIBLE EFFECT—A PLOT IS GENERATED

DEFAULT —NOT APPLY

EXAMPLES —PLOT Y X

PLOT SIN(X) FOR X = 0 .1 5 PLOT Y PRED VERSUS X

Such on-line documentation is a useful feature

which saves the analyst from a time-consuming

look-up in a hardcopy manual. The HELP output
6-16

is not meant to be all-inclusive and

comprehensive ; rather, it is meant to summarize

salient points pertaining to commands.

At times it is convenient to divert the output

from the HELP command so that it does not come back to the terminal, but rather is directed out

to some user-defined mass-storage file. For example, suppose the analyst wanted the HELP

output for the following commands—

PLOT

TITLE

LABEL

CHARACTERS

LINES

FONT

HARDCOPY

to be printed out to a file (pre-existing) which

has a numeric designation of, say, 12. This may be

done by use of the HELP and SET commands in the

following fashion —

SET IPR 12

HELP PLOT

HELP TITLE

HELP LABEL

HELP CHARACTERS

HELP LINES

HELP FONT

HELP HARDCOPY

SET IPR 6

The SET IPR 12 command redefines the standard

output unit from default (usually 6) to 12. All

subsequent output will thus be diverted to the

file with numeric designation 12—no output will

appear at unit 6 (the terminal ) . The HELP PLOT

command will produce output to unit 12, as will

the succeeding HELP commands. The last command

(SET IPR 6) will redefine the standard output

unit to be 6 again, and so control will return to the terminal. The net result is that the file

with numeric designation 12 will contain all of

the line images which DATAPLOT would normally

send to the terminal. After exiting out of

DATAPLOT, the analyst may then peruse this file

at will and/or send it off to the printer via a local system print/list utility command.
6-17

Redimens ioning Internal

DIMENSION

Storage

Upon signing onto DATAPLOT , a message will be

generated which states the limits (for your

particular computer) of internal data storage in

DATAPLOT. The usual limits are

1) maximum number of variables - 10

2) maximum number of observations

per variable = 1,000

3) maximum total internal data storage = 10 x 1,000 = 10,000

The maximum total internal data storage size is

typically fixed (here = 10,000) and unchangeable;

however, the analyst does have some flexibility in terms of changing the number of variables (from 10

to something larger than 10) and in terms of

: changing the maximum number of observations per

variable (from 1,000 to something smaller than

1,000). In any event, if the analyst changes

either the number of variables , or the maximum

number of observations per variable, the

! overriding constraint will exist that their

product will = the total internal data storage

size (= 10,000).

The DIMENSION command allows the analyst to change

the number of variables , or the maximum number of

observations per variable, (or both). To change

the upper limit on the number of variables from 10

to, say, 200, enter

DIMENSION 200 VARIABLES

or ( equivalently

)

DIMENSION 200 COLUMNS

A message will result stating that the

1) maximum number of variables = 200

2) maximum number of observations

per variable = 50

3) maximum total internal data storage = 200 x 50 = 10,000

Note that in addition to the number of variables

being changed from 10 to 200, the maximum number

of observations per variable has also been

automatically changed from 1,000 to 10,000/200 =

50.

Similarly , to change the maximum number of

observations per variable from 1000 to, say, 250,

enter

DIMENSION 250 OBSERVATIONS

or (equivalently

)

DIMENSION 250 ROWS

A message will result stating that the

1) maximum number of variables = 40

2) maximum number of observations

per variable = 250

3) maximum total internal data storage =

40 x 250 = 10,000

Note that in addition to the maximum number of

observations per variable being changed from 1,000

to 250, the number of variables has also been

automatically changed from 10 to 10,000/250 = 40.

Current (1/83) configurations of DATAPLOT do not permit the DIMENSION statement to change the

number of variables to more than 200, nor to change the maximum number of observations per

variable to more than 1,000. However, with

hardware advances in memory sizes occurring so rapidly, it is clear that future versions of

DATAPLOT will have both of these limits raised

considerably
6-18

Specifying the Terminal

TERMINAL

The TERMINAL command allows the analyst to specify

the particular terminal being used. The default

terminal is a Tektronix 4014 or equivalent. The TERMINAL command should specify both the

manufacturer and the model number, as in

TERMINAL TEKTRONIX 4027

TERMINAL TEKTRONIX 4010

TERMINAL RAMTEK 6011

When the TERMINAL command is processed by

DATAPLOT, it will automatically adjust internal

settings relating to

1) whether or not the terminal is

continuous or discrete ;

2) whether or not the terminal is

color or non-color

;

3) the number of screen picture points

(horizontal and vertical) for the

terminal

.

Specifying the Host

HOST

The HOST command is seldom used. This command

specifies the current host. Usually such a host-specification is automatic upon signing onto

DATAPLOT, hence its rare usage. The form for the

HOST command includes both the computer

manufacturer and model number, as in

HOST VAX 11/780

HOST UNIVAC 1100/82

HOST IBM 4341

HOST IBM PC

Thus the use of the TERMINAL command obviates the

need for the CONTINUOUS/DISCRETE command, the

COLOR command, and the PICTURE POINTS command.
6-19

Specifying the Communications Link

COMMUNICATIONS LINK and BAUD RATE

The commands in this section are rarely used. The

motivation for their inclusion stems more from

completeness and the ability to address potential

future problems than actual past problems

When multiple terminals are running DATAPLOT from

| a common host, the terminals may be running over

communication links that have differing baud

j rates. This can at times lead to timing and

buffering problems in the terminal hardware as it

interacts with the underlying continuous graphics

| software . Typical indications that such problems

are occuring are that graphs will be

generated which are clipped (incomplete) —parts

| of the plot which should be drawn (usually frame

lines) remain undrawn.

A common local cause of this is that plot

directives are being processed by the terminal

while a screen erasure is still in progress. It takes a typical display terminal about 1 full

second to erase the screen. In that second, the

terminal should be buffering commands and/or the

graphics software should be sending null character

strings. In order for the proper number of nulls

to be sent, it is necessary that the underlying

graphics software be correctly informed of the

communication baud rate. If the actual baud rate

is faster than the default baud rate, then an

insufficient number of nulls will be generated in

order for the screen erasure to be completed . In

such case, the terminal hardware buffering must

take over. If the terminal hardware has such

buffering , then the plot will be properly formed;

however, if the terminal hardware does not have

buffering, then the plot will be clipped.

The default internal DATAPLOT baud rate setting is

1200. Usually this baud rate does not have to be

reset (well over 95% of all DATAPLOT runs at the

| NBS implementation are done under the default baud

rate—even though the terminals are running

anywhere from 300 baud to 19200 baud). However,

if such clipping problems do arise, then the baud

rate setting may be the problem. To change this

j rate, use the BAUD RATE command, as in

never receives them. The net effect is missing

parts on the graph, glitches on the graph, or improperly- formed components on the graph.

If the analyst is having problems in the formation

of continuous graphs, and if the problem is

traceable to the communications link, then it will

be necessary to inform DATAPLOT of the type of

communications link so that local systems

personnel may adjust the internal code depending

on the type of link. The default link is the

standard phone lines (as would be used, e.g., with

an acoustic coupler). To change the link

specification, use the COMMUNICATIONS LINK

command, as in

COMMUNICATIONS LINK NETWORK

COMMUNICATIONS LINK ARPANET

COMMUNICATIONS LINK ETHERNET

Specifying the baud rate is done occasionally ; specifying the communications link is done even

less frequently

BAUD RATE 9600

III The type of communication link may also affect the

(continuous) graphics information being

transmitted . For example, the phone line rarely

"eats' or "adds" control characters to a transmission, but some specialized communication

networks do "eat/add" certain character sequences.

|j It is common for graphics software directives to involve 'escape" sequences ; it is also common for

some intelligent communication networks to have

i command directives which themselves involve

\ > "escape* sequences. Thus when the graphics

| software sends such sequences, the network itself

i intercepts (and acts on) them, and the terminal

i
6-20

Specifying Trigonometric Units

TRIGONOMETRIC UNITS

DATAPLOT has an extensive set of trigonometric and

inverse trigonometric library functions

.

Trigonometric calculations may be carried out in

radians, degrees, or grads (as is common in

Europe). The default unit is radians. If it is

desired to have trigonometric calculations in

degrees , then enter

TRIGONOMETRIC UNITS DEGREES

or simply

DEGREES

All subsequent trig calculations will thus be

carried out in degrees. To change the angle units

to grads, enter

TRIGONOMETRIC UNITS GRADS

or

GRADS

To change the angle units back to radians, enter

TRIGONOMETRIC UNITS RADIANS

or

RADIANS

Another instance in which the angle units comes

into play is in the scribing of text strings on a plot or diagram at an angle other than horizontal

.

For example, to write the text string abc starting

in the middle of the screen in triplex font, one

would enter

but an alternative valid way is

TRIGONOMETRIC UNITS RADIANS

LET A = PI/

4

ANGLE A FONT TRIPLEX

MOVE 50 50 TEXT ABC

ANGLE UNITS GRADS

ANGLE 50

FONT TRIPLEX

MOVE 50 50

TEXT ABC

Note that all of DATAPLOT 's fonts may be written

at any angle (except the Tektronix font —which is

a terminal-hardware-generated font that may only

be written in the usual horizontal (angle = 0)

fashion )

.

A synonym command for the TRIGONOMETRIC

command is the ANGLE UNITS command, thus

TRIGONOMETRIC UNITS DEGREES

and

ANGLE UNITS DEGREES

have the same effect

.

UNITS

FONT TRIPLEX

MOVE 50 50

TEXT ABC

How would one write the same text string at a 45

degree angle? To do so, one uses both the

TRIGONOMETRIC UNITS and the ANGLE command. The

TRIGONOMETRIC UNITS command specifies the desired

units (radians , degrees, or grads); the ANGLE

command specifies the desired angle of the text string (in whatever angle units that were chosen).

For example, to write out the text string abc in

triplex font at an angle of 45 degrees, the

easiest way is

TRIGONOMETRIC UNITS DEGREES

ANGLE 45 FONT TRIPLEX

MOVE 50 50 TEXT ABC
6-21

Echoing Commands

ECHO

When running pre-stored DATAPLOT programs , it is

at times convenient to have the commands echoed

back as they are being executed . To do this, one

enters

ECHO

or

ECHO ON

somewhere up near the beginning of the code.

The echoed commands will appear in an easily-noticeable box as they are being executed

,

The output from the execution of each command

will appear immediately below the box. Thus the

effect of

LINES SOLID DOT DASH

CHARACTERS ABC

is the usual

LINE 1 HAS JUST BEEN SET TO SOLI

LINE 2 HAS JUST BEEN SET TO DOT

LINE 3 HAS JUST BEEN SET TO DASH

1 HAS JUST BEEN SET TO A

2 HAS JUST BEEN SET TO B

3 HAS JUST BEEN SET TO C

; whereas the effect of

ECHO ON

LINES SOLID DOT DASH

CHARACTERS ABC

****************************

** LINES SOLID DOT DASH ** ****************************

LINE 1 HAS JUST BEEN SET TO SOLI

LINE 2 HAS JUST BEEN SET TO DOT

LINE 3 HAS JUST BEEN SET TO DASH

************************

** CHARACTERS ABC ** ************************

When operating in a high baud rate environment in

which information comes back to the terminal at a very fast rate, the use of the ECHO command will

allow the analyst not only to see the output from

DATAPLOT commands, but also the specific

command line which generated the output. The net effect is that the analyst will more easily follow

the execution of the pre-stored DATAPLOT code.

This is convenient in monitoring the analysis

and making sure that the analysis is proceeding

as expected

CHARACTER

CHARACTER

CHARACTER

CHARACTER

CHARACTER

CHARACTER

1 HAS JUST BEEN SET TO A

2 HAS JUST BEEN SET TO B

3 HAS JUST BEEN SET TO C
6-2?

Suppressing Printed Output

FEEDBACK and PRINTING

All of DATAPLOT's commands result in some form of

printed output. A broad partitioning of all

DATAPLOT commands could consist of

1) Graphics commands;

2) Analysis commands ; 3) All other commands ( = secondary commands).

The commands in the GRAPHICS category (PLOT,

HISTOGRAM, SPECTRUM, 3D-PLOT, NORMAL PROBABILITY

PLOT, etc.) all result in immediate graphics

output which is typically important in terms of

carrying out the analysis. Such output is usually

not suppressed

.

The commands in the Analysis category (FIT, SPLINE

FIT, ANOVA, SMOOTH, SUMMARY, LET, etc.) all have

immediately-printed output which is of interest in terms of carrying out the goals of an analysis

.

With the possible exception of output from the LET

command, the suppression of such output is rarely

done

.

The remainder of DATAPLOT's commands (such as CHARACTERS, LINES, READ, DIMENSION, DELETE,

LEGEND, TITLE, LABEL, etc.) are not really end

objectives in an analysis , but rather are necessary intermediate steps in carrying out an analysis precisely to one's specifications . These

secondary commands also generate printed feedback

information which assures the analyst that the

command that the host received was identical to the command that was entered through the keyboard

.

This feedback information is comforting and

reassuring to the analyst in that the specified

commands are resulting in the desired action.

Such feedback rarely "gets in the way" and is the

default when one signs onto DATAPLOT . Occasions

do arise, however, when it would be desirable to be able to suppress such feedback. To do so, enter

FEEDBACK OFF

When the FEEDBACK OFF command has been received,

all feedback information from all secondary

commands , (and all usual output from the LET

command), will be suppressed . The most common occurrence of this is in the generation of

diagrammatic graphics (diagrams, schematics, word

charts, etc.) where one wishes to suppress

feedback messages so that they will not clutter up

the screen as the diagram is being formed. For example, the execution of the following pre-stored

DATAPLOT program

FONT TRIPLEX ITALIC

HEIGHT 5 WIDTH 3 JUSTIFICATION CENTER

ERASE

MOVE 50 80

TEST GRAPHICS

HEIGHT 2 WIDTH 1

MOVE 50 70 TEXT ANALYSIS GRAPHICS

MOVE 50 60 TEXT PRESENTATION GRAPHICS

COPY

will (upon execution) result in the desired word

chart being formed, but will also have the word

chart "ruined" because the automatic feedback

information from the

HEIGHT 2 WIDTH 1

commands will also appear superimposed on the word

chart

.

To circumvent this problem, the above code should

be amended to

FONT TRIPLEX ITALIC

HEIGHT 5 WIDTH 3 JUSTIFICATION CENTER

FEEDBACK OFF

ERASE

MOVE 50 80

TEST GRAPHICS

HEIGHT 2 WIDTH 1 MOVE 50 70 TEXT ANALYSIS GRAPHICS

MOVE 50 60 TEXT PRESENTATION GRAPHICS

COPY

The desired word chart—uncluttered by feedback

information—will be formed.

To counteract the FEEDBACK OFF command, enter

FEEDBACK ON

FEEDBACK

We have seen how the FEEDBACK OFF command will

suppress output from all secondary commands and

from the LET command. Is there any way to suppress output from any of the Analysis category

commands other than LET (e.g., FIT, SPLINE FIT,

ANOVA, SMOOTH, SUMMARY, etc.)? Although such

suppression is rarely done, it may be carried out by entering

PRINTING OFF

To counteract this command, the analyst enters

PRINTING ON

or

PRINTING
6-23

Diverting Graphics Output to Offline Devices

PENPLOTTER, ZETA, CALCOMP , and VERSATEC

When generating graphics on a terminal, it is at times convenient to have such graphics not only

appear on the screen, but also to route them to alternate graphics device. If the analyst enters

the

PENPLOTTER

PENPLOTTER ON

command, then all subsequent plots will also

appear on the local penplotter (e.g., Tektronix

4662). This penplotter must be connected in serial

between the host and the terminal. When using a penplotter, the analyst must have the proper baud

rate (typically quite slow due to the mechanical

nature of the penplotter), and also must have the

proper communication switch settings on the

penplotter (which depends on the nature of the

communications link and the host).

The name of the plot file which DATAPLOT writes

such information out to is DPPL1F . DATAPLOT

automatically creates this file when these

alternate plot devices are specified . The FORTRAN

unit number that DATAPLOT assigns to this file is

43. The file is temporary (it will remain after

the analyst signs off of DATAPLOT, but will

disappear when the analyst logs off the computer).

When the analyst signs off of DATAPLOT , a message

will be generated which reminds the analyst what

file name (DPPL1F) and file number (43) were

given to the plot file, and will also give the

analyst instructions on how to post-process the

file so that the Tektronix characters may be

converted to Zeta, Calcomp, Versatec , etc. plots.

To consider a specific example, note the following

program—

ZETA PLOT X**2 FOR X

EXIT

= 1 1 10

To turn the penplotter off, the analyst enters

PENPLOTTER OFF

For other offline devices (such as the Zeta,

Calcomp, and Versatec plotters )

, the analyst

should enter the commands

ZETA CALCOMP

VERSATEC

When the

ZETA

command is encountered, the following feedback

message will appear—

DEVICE 2 INFORMATION

POWER —ON

MANUFACTURER —ZETA

CONTINUITY —ON

COLOR —OFF

PICTURE POINTS— 1000 1000

ZETA ON

CALCOMP ON

VERSATEC ON

Note that "device 2" is any alternate graphics

output device, while "device 1" is the terminal

itself.

When the

respectively . The net effect of any of these

commands is the same in DATAPLOT, namely, to capture whatever graphics information is going to

the screen, allow it to proceed to the screen, but

also write that same information out to a plot

file. The net result is that when the DATAPLOT

session is finished , the analyst will have in this

plot file a full record of all the character

strings that (when sent to chc Tektronix terminal

)

would cause the plots to reform. In fact, such

plots could be reformed by simply going into the

\Plot file with the local editor and printing out

some number of lines with an editor print. If the

terminal being used is a Tektronix, then the plot

will reform; if the terminal being used is a Tektronix- incompatible or an alphanumeric

(non-graphics ) terminal, then lines of

unintelligible gibberish will appear.

PLOT X**2 FOR X = 1 1 .10

is encountered , the screen will erase, and the

quadratic plot will appear. While this is

happening , the same character strings which caused

the plot to form on the screen are being copied

into file DPPL1F (= file 43).

When the analyst enters

EXIT

DATAPLOT will remind the analyst that an alternate

plotting device has been specified , and will

provide the following feedback messages—
6-24

NOTE—THE ALTERNATE PLOT FILE

IS CLOSED.

THE NAME OF THE FILE IS DPPLlF

.

TO EXAMINE THE FILE, USE ANY EDITOR,

(§EDM, @ED, @CTS, ETC.), AS IN §EDM,Q DPPLlF.

P * TO SEND THE FILE TO THE ZETA , ENTER @NBS*PLIB$ .AUNIPLOT,I DPPLlF. , ,ZETA , FMT/TEK

WHERE THE I OPTION ALLOWS UP TO 3 LINES OF

OPERATOR DIRECTIVES (PEN, POINT, COLOR, PAPER)

THIS IS AN EXIT FROM DATAPLOT

.

Note that the contents of the exit message are clearly site-dependent. The above message was captured from output generated on the NBS Univac

1100/82. @EDM, §ED, §CTS are local Univac

editors; and

§NBS *PLIB$ .AUNIPLOT , I DPPLlF. , ,ZETA, FMT/TEK

is a local Univac post-processor (completely

independent and separate from DATAPLOT) which

allows any file (in particular, file DPPLlF)

containing Tektronix graphics strings to be

converted and send to the NBS Zeta plotter.

Under current (1/83) configurations , DATAPLOT will not write directly to the Zeta, Calcomp, or Versatec ) ; rather, DATAPLOT writes a Tektronix

graphics string file (the same file regardless of

whether the ultimate device is the Zeta, Calcomp,

Versatec , or some other device), and then the

analyst must apply a locally-provided

,

system-dependent post-processor to this file to send its contents to its ultimate destination.

DATAPLOT does not provide the Tektronix-to- . .

.

post-processor ; it must be locally provided . In this regard, 2 items are noted—

1) future versions of DATAPLOT will have

direct writing to alternate graphics

devices;

As many plots as desired may be written out to the

alternate plot file. Caution should be exercised

in multiple opening and closing of the alternate

plot file during the same DATAPLOT session—this

should not be done because subsequent openings of

the file will overwrite the existing plots on the

file. For example, consider the following 10-line

DATAPLOT program—

ZETA ON

PLOT X FOR X = 1 1 10

PLOT X**2 FOR X = 1 1 10 ZETA OFF

ZETA ON

PLOT X**3 FOR X = 1 1 10 PLOT X**4 FOR X = 1 1 10 ZETA OFF

I The net effect is that the linear and quadratic

plot residing on file DPPLlF will be overwritten

by the cubic and quartic plots. If all 4 plots were desired to be on the file, then the program

should be amended to

ZETA ON

PLOT X FOR X = 1 1 10

PLOT X**2 FOR X - 1 1 10

PLOT X**3 FOR X = 1 1 10

PLOT X**4 FOR X = 1 1 10 ZETA OFF

I,

2) it has been reported (though not yet

substantiated ) that commercially-available

post-processors are being developed

for a variety of computers and a variety of

output devices.

Note that if the analyst enters

ZETA OFF

CALCOMP OFF

VERSATEC OFF

then DATAPLOT will also close the alternate plot

file, and will provide the same feedback messages

.

As in the example above, if the analyst chooses to leave the file open, then upon exit from DATAPLOT

,

it will automatically be closed.

I
Redefining I/O Units and Saving DATAPLOT Output

SET

For most computers

,

1) the default numeric designation

for the input unit is 5;

2) the default numeric designation

for the input unit is 6.

i The underlying code in which DATAPLOT is written

is FORTRAN (ANSI 77). The underlying FORTRAN

variable names which specify the above 2 default I/O unit numbers are

1) IRD for the input unit;

2) IPR for the output unit.

Whenever DATAPLOT is reading commands from the

terminal, it is reading from unit 5; whenever

DATAPLOT is sending information back to the

terminal (both non-graphics and graphics

i| information ) , it is writing to unit 6.

We have seen in other sections how the use of the

ZETA, CALCOMP, and VERSATEC commands allows us to capture graphics information and copy it out to a file (file DPPLlF = file 43). This leads us to

the question of how one might capture all

information (graphical and non-graphical) and

place it in a file (perhaps for future perusal, or perhaps to increase execution speed). Although

this is rarely done, it is nevertheless

possible—via the SET command. The SET command

allows us to change a variety of underlying

FORTRAN settings ; we focus here on altering the

' settings of the IRD and IPR variables . The form

for the SET command is

SET FORTRAN variable name Desired setting

Thus to change the standard input unit from 5 to

11, one could enter

SET IRD 11

and to change the standard output unit from 6 to

21, one could enter

SET IPR 21

Note that if the analyst changes the standard

output unit from the terminal to some file, then

all output will go to that file (and no output

will go to the terminal). Such a file may, of

course, be subsequently perused and edited. In practice, the 'average' analyst will rarely (if

ever) find the need to change IRD and IPR

, settings.
6-26

Controlling The Terminal—Eras ing , Hardcopy ing , etc.

PRE-ERASE, HARDCOPY, ERASE, and COPY

The following 4 commands are useful to control

elementary erasing and copying operations at the

terminal —

PRE-ERASE

HARDCOPY

ERASE

COPY

The PRE-ERASE command, as in

PRE-ERASE ON

or simply

PRE-ERASE

instructs DATAPLOT that every subsequent plot

command (that is, every command from the Graphics

category—PLOT, BOX PLOT, 3D-PL0T, CONTROL CHART,

LAG ... PLOT, HISTOGRAM, SPECTRUM, etc.) should

automatically erase its screen prior to the

plotting operation . Since graphics is a core DATAPLOT operation, this automatic pre-erasure is

reserved for all of the commands in the DATAPLOT

Graphics category . Only commands in this

category have this automatic pre-erasure option.

Note that the default setting for plot pre-erasure

is ON, and so the analyst only rarely needs to explicitly enter the PRE-ERASE command. To turn

the pre-erasure off, the analyst enters

PRE-ERASE OFF

This capability is only occasionally used. Its main use arises in the superposition of plots atop

one another, as in

XLIMITS 10 20

YLIMITS 100 150

PRE-ERASE OFF

ERASE

PLOT Yl X PLOT Y2 X

PLOT Y3 X

etc. This program will

1) Set the x-axis limits to 10 and 20 for

all subsequent plots (so that all

superimposed plots have the identical

scale)

;

2) Set the y-axis limits to 100 and 150 for

all subsequent plots (for the same

reason)

;

3) Turn off the automatic plot pre-erasure

(so that the second, third, etc. plots

do not erase the screen when they are being superimposed )

;

4) Manually erase the screen prior to the

first plot;

5) Generate one plot;

6) Superimpose a second plot;

7) Superimpose a third plot;

8) etc.

The superposition of plots in this fashion allows

us to generate plots with an indefinitely large

number of plot points—thus circumventing any

DATAPLOT restrictions that might exist as to maximum number of points per plot.

The automatic , "hands-off copying of all

generated plots to the local hardcopy units is a convenient feature. To activate this feature, the

analyst enters

HARDCOPY ON

or simply

HARDCOPY

Every plot command subsequently entered will

result in not only the plot being generated on the terminal screen, but also the plot beinc

automatically copied to the local hardcopy unit at\ soon as the plot finishes constructing itself oi the screen

.

To specify multiple hardcopies per plot, th< analyst appends the desired number to the end o. the command, as in

HARDCOPY ON 3

or HARDCOPY 3

which will make 3 local hardcopies of every plo

which appears on the screen.

To terminate the automatic copying of plots, th

analyst enters

HARDCOPY OFF

The default setting of the plot hardcopy switch i off.

The PRE-ERASE and HARDCOPY commands are passiv

commands—they set internal switches which az later scanned when plot commands are entered. Tt last 2 commands (ERASE and COPY) are activl

commands in the sense that when these commands aim

encountered , something happens immediately—tl I terminal erases its screen, or the terminal make\ a local hardcopy of the current contents of tit, screen

.
6-27

To erase the screen under program control , use the

ERASE command. To copy the contents of the screen

under program control, use the COPY command.

Anytime DATAPLOT encounters the ERASE and COPY

commands , the screen will be immediately erased

and copied, respectively . In addition , if the

analyst is running interactively from a terminal,

the terminal itself usually has erase and copy

keys which may be manually depressed. The ERASE

and COPY commands are, however, more convenient to

use because they may be entered in pre-stored

DATAPLOT programs. A typical example of when the

ERASE and COPY commands are useful is

ERASE

FIT Y = some model

COPY

This program will

1) erase the screen;

2) generate the usual FIT output;

3) copy the FIT output to the hardcopy unit.

Another example is in diagrammatic graphics, as in

FONT TRIPLEX ITALIC

JUSTIFICATION CENTER

ERASE

MOVE 50 50 TEXT ABC

COPY

This program will

1) Set the font style to triplex italic;

2) Set the justification to center justified

3) erase the screen;

4) move to the middle of the screen;

5) write out the text string ABC ;

6) copy the screen to the hardcopy unit.
6-28

Activating Local Settings

IMPLEMENT

The IMPLEMENT command allows the analyst to automatically activate local settings,

conventions, and preferences. The form of the

command is

IMPLEMENT number

as in

IMPLEMENT 1

AND

IMPLEMENT 2

Different installations have different features —

depending on local preferences . For example, at NBS, we have only 2 local settings which may be

accessed via the IMPLEMENT command. If the

analyst here enters

IMPLEMENT 1

then this would be equivalent to the following 5 lines of code—

X2TIC MARKS OFF

X2TIC MARK LABELS OFF

Y2TIC MARKS OFF

Y2TIC MARK LABELS OFF

Y2LABEL

and so the IMPLEMENT 1 command would have the net

effect of causing all subsequent plots to be

produced with neither tic marks nor tic mark

labels on the upper and right frame lines, and

with no vertical label on the right side of the

frame. If the NBS analyst entered

IMPLEMENT 2

then this would be equivalent to entering

FRAME CORNER COORDINATES 15 20 75 85

that is, this would cause all subsequent plots to have a square shape rather than the default

rectangular shape. Such a square shape is, for

example, useful in Youden plots (an

inter laboratory graphical data analysis

technique) . The IMPLEMENT 1 and IMPLEMENT 2 commands at other installations will typically

cause these same 2 features to be activated

.

In addition , the local DATAPLOT service group

may have added other convenient features

which could be accessed via IMPLEMENT 3,

IMPLEMENT 4, etc. Check the local DATAPLOT

service group for such augmentations.
6-29

Entering Comment Lines

COMMENT and .

It is good programming practice to enter

non-executable comments in stored DATAPLOT

programs. There are 2 wags to enter a comment

line—

1) via the COMMENT command;

2) via the . command.

The latter is easier to read because it has been

separated into functionally-modularized "chunks"

of code. The programs would execute identically

Note that the COMMENT command (and the . command

in particular ) must be followed by at least 1 space so as to separate it from any remaining

text on the line; thus

The 2 commands (COMMENT and .) are equivalent.

Any DATAPLOT statement that starts with COMMENT or

will become a null (or "no-op" ) statement —such

statements are non-executable. The following

programs are identical —

COMMENT CALIBRATION ANALYSIS

COMMENT JANUARY 1983

READ XYZ. X Y TITLE CALIBRATION

PLOT Y X

LET A = 10 LET B = 5 LET C = .5 FIT Y = A+B*EXP(-C*X)

CHARACTERS X BLANK

LINES BLANK SOLID

PLOT Y PRED VERSUS X

PLOT RES X

i and

. CALIBRATION ANALYSIS

. JANUARY 1983

READ XYZ. X Y TITLE CALIBRATION

PLOT Y X

LET A = 10

LET B = 5 LET C = .5 FIT Y = A+B*EXP(-C*X)

CHARACTERS X BLANK

LINES BLANK SOLID

PLOT Y PRED VERSUS X

PLOT RES X

Note that the . command is often useful for

| visually segregating chunks of DATAPLOT code.

Note the difference between the above code and

. CALIBRATION ANALYSIS

. JANUARY 1983

READ XYZ. X Y

TITLE CALIBRATION

PLOT Y X

LET A = 10 LET B = 5 LET C = .5 FIT Y = A+B*EXP(-C*X)

CHARACTERS X BLANK

LINES BLANK SOLID

PLOT Y PRED VERSUS X

PLOT RES X

. CALIBRATION ANALYSIS

is correct, but

.CALIBRATION ANALYSIS

is incorrect .

If COMMENT or . is not followed by any text, then

the trailing space is, of course, not needed- -COMMENT and . may be succeeded immediately

by a carriage return.

The . command is also a convenient way of

"commenting out" code (in stored DATAPLOT

programs) that we have already executed in

previous runs, that we no longer wish to execute,

but still wish to retain in the code as a memory

aid. For example, suppose we executed the above

code which fitted the model Y = A+B*EXP( -C*X ) , but now wish to execute the same code with the model Y

= A+B*X**C. We could delete (via the local

editor) the original FIT statement from the stored

code, but alternatively we may wish to simply

"comment out" the original FIT statement as a reminder of models that were already tried; as in

. CALIBRATION ANALYSIS

. JANUARY 1983

READ XYZ. X Y

TITLE CALIBRATION

PLOT Y X

LET A = 10 LET B = 5 LET C = .5

. FIT Y = A+B*EXP(-C*X)

FIT Y = A+B*X**C

CHARACTERS X BIANK

LINES BLANK SOLID

PLOT Y PRED VERSUS X

PLOT RES X
6-30

Recommended Programming Practices

When constructing (via the editor) DATAPLOT

programs (that are to be stored in a file/subfile)

for later execution, it is recommended that

liberal use of comments (especially at the

beginning of the code) be used. The COMMENT

command and the . command assist in this regard.

Liberal use of the . command to visually separate

chunks of DATAPLOT code also make for easier

reading and understanding of the code

after-the-fact . Contrast, for example, the

following 2 DATAPLOT programs—both of which are

identical in execution—

READ XYZ. X Y TITLE CALIBRATION ANALYSIS

YLA BEL PRESSURE

XLABEL TIME PLOT Y X LET A = 1 LET B = 10 LET C = .5 FIT Y = A+B*SQRT(C+X

)

CHARACTERS LINES BLANK

LINES BLANK SOLID

PLOT Y PRED VERSUS X

YLABEL RESIDUALS

PLOT RES X

and

. CALIBRATION ANALYSIS

. SPECIMEN 247

. JANAURY 1983

READ XYZ. X Y

TITLE CALIBRATION ANALYSIS

YLABEL PRESSURE

XLABEL TIME

PLOT Y X

LET A = 1 LET B = 10 LET C = .5 FIT Y = A+B*SQRT(C+X)

CHARACTERS LINES BLANK

LINES BLANK SOLID

PLOT Y PRED VERSUS X

YLABEL RESIDUALS

PLOT RES X

A common set of commands which often appears at

the beginning of many DATAPLOT runs (whether

running interactively , or running stored DATAPLOT

programs ) is

The ECHO ON command tells DATAPLOT to echo back

all entered commands ( in a noticeable box) as the

commands are being executed . If one is running a stored DATAPLOT program in a rapid-fire fashion,

then the echoing helps to keep track of exactly

what command is being executed—because one sees

not only the produced output (which may "fly by"

and fill the screen quickly )

, but also one sees

the specific input command that produced the

output. This is useful for monitoring the

execution of "canned" programs.

The HARDCOPY ON command causes every plot which

appears on the terminal screen to be automatically

copied to the local hardcopy unit. This "hands

off feature is very helpful in producing a record

of how the analysis proceeded

.

The SEQUENCE ON command causes an automatically- incremented sequence number to appear (inconspicuously) in the upper right corner of plots as they are being generated . When used in

conjunction with the HARDCOPY ON command, it gives

the analyst an ordered set of graphics output

which provides a valuable record of how a data: analysis proceeded.

For doing analysis graphics (= graphics foi extracting structure from data), the analyst

should use the default Tektronix font for th( titles, labels, legends, etc. This font i| not as "pretty" as the fancier-script fonts

but is quite adequate, very readable , and i|

quickly generated . For such graphical dat. analysis , the default Tektronix is more tha

adequate and will not slow down the

analysis . One should wait until the end of th

analysis —when structure has been extracted an when conclusions have been formulated—befor one uses the fancier fonts. As the analysi^

graphics stage is being finished, and th presentation graphics (= graphics fc communicating conclusions via journals, seminars

etc.) stage is being started, then the analyt,

should consider using the "fancier" fonts. l\ switch to such fonts is a one-command operatic

in DATAPLOT, namely the FONT command, as in

TITLE LINE STANDARDS ANALYSIS

YLABEL WIDTH

XLABEL POSITION

FIT Y = A+B*X

CHARACTERS X BLANK

LINES BLANK SOLID

PLOT Y PRED VERSUS X

FONT TRIPLEX ITALIC

PLOT Y PRED VERSUS X

ECHO ON

HARDCOPY ON

SEQUENCE ON
6-31

The titles and labels from the first plot will be

default Tektronix font —they will be generated

very fast; the titles and labels from the second

plot will be in triplex italic font—they will

take more time to generate , but will be of much

higher quality.

Of all the plot control commands available in

DATAPLOT, the 2 commands which the analyst will

find him/herself using most heavily are the

CHARACTERS and LINES commands. The CHARACTERS

command specifies the desired plot characters to appear at the plot points of a trace; the LINES

command specifies the desired line type which

connects the various plot points of the trace.

The default character type is blank, and the

default line type is solid. These defaults allow

for the rapid continuous-trace plotting of data

sets and functions . Display terminals typically

take longer to generate traces which have

non-blank plot characters than those with blank

plot characters —such terminals draw solid traces

\ very rapidly, but draw individual characters much

more slowly. If the trace has 100 points or so, then the time difference will be neglible ; if the

trace has 1000 points, then the time difference

will be noticeable . As the electronics of display

terminals improve, this time-of-plot consideration

should disappear

A particular case of the CHARACTERS and LINES

command which arises time and time again whenever

a fitting operation has been carried out is

4) plot the raw data (Y) versus X and

superimpose the predicted values (PRED)

from the fit versus X. Note that the Y versus X trace will have X's as plot

characters and no connecting lines, and

the PRED versus X trace will have blank

plot characters and a solid connecting

line. The usual form for the

superimposed plot of raw data and

predicted values is to have the raw data

appear as discrete X's and the predicted

values to appear as a solid trace. The

above CHARACTERS and LINES commands in

conjunction with the PLOT Y PRED VERSUS X

command allow the analyst to do this

easi 1 y

5) plot the residuals (RES) from the fit versus X. Note that since only 1 trace

is being outputted here, then the plot

will follow the first specification of

the above CHARACTERS and LINES commands,

namely to have X's as plot characters,

and to liave no connecting lines.

CHARACTERS X BLANK

LINES BLANK SOLID

The usual context in which this appears is

FIT Y = some model

CHARACTERS X BLANK

LINES BLANK SOLID

PLOT Y PRED VERSUS X PLOT RES X

The above code will

i| 1) carry out a fit according to some model,

and automatically store the resulting

predicted values (in a variable named

PRED) and residuals ( in a variable named

RES) .

2) specify that the characters on succeeding

plots have X's for the first trace, and

blanks for the second trace ( if there is

a second trace);

3) specify that the lines on succeeding

plots have no connecting lines for the

first trace, and solid connecting lines

for the second trace (if there is a second trace);
Interrupting, Saving, Starting Over

and Resuming A Run RESET

SAVE and RESTORE

Suppose one is in the middle of an interactive

session with DATAPLOT, and one is forced to interrupt a run (to go to a seminar, say). In such case it would be extremely convenient to be

able to save all of DATAPLOT ' s internal

settings so as to be able to continue the run at some later time. To do so, one uses the SAVE

and RESTORE commands. The form for the SAVE

command is

SAVE XYZ.

where XYZ is a pre-existing user file to which all

of the internal DATAPLOT settings will be dumped.

Upon signing onto DATAPLOT at a later time, the

analyst would enter

RESTORE XYZ.

and then proceed with the analysis at precisely

the point of interruption. As with all DATAPLOT

commands which involve file/subfile usage, the

file name should be followed by a period in the

command statement; thus

SAVE XYZ.

is correct, but

SAVE XYZ

is incorrect.

Note that the RESTORE command requires the save

file to pre-exist. For many computers, such a requirement may be circumvented by local operating

system directives. For example, on UNIVAC

computers , if file XYZ does not exist and yet is

needed in the middle of a DATAPLOT run, then the

analyst may enter

@@ASG,UP XYZ.

and that will create a file XYZ while still

leaving the analyst in DATAPLOT. For other

computers , the analyst should check locally to see

if a similar system capability exists.

It is at times convenient to simply reset all of

DATAPLOT 's internal settings to their sign-on

initial values. One way to do this is, of course,

to simply exit out of DATAPLOT (via EXIT) and then

sign back onto DATAPLOT (via the local sign-on

procedure). An alternate way to do the same is to use the RESET command, as in

RESET

This will reinitialize all internal data settings

(including, of course, all variable, parameter

,

and function settings ) . A synonym for RESET is

CLEAR

.
Communicat ing

6-33

with the Host Operator

OPERATOR

The OPERATOR command allows the analyst to send a message (while in the middle of a DATAPLOT run) to the host operator . The form of the command is

OPERATOR message

Check locally with the DATAPLOT Service Group to determine if this feature has been implemented

,

and to determine if there are any restrictions on

this feature (for example, the NBS Univac 1100/82

restricts the number of characters per line for a given message to be 40 at most). If it is

necessary to send a multi-line message, then each

line should start with the OPERATOR command, as in

OPERATOR Please set Zeta plotter with

OPERATOR wet ink HI pen (red) and 30 inch paper.

OPERATOR Please send output to room 707.
6-34

Communicating with DATAPLOT Service Group

MESSAGE , NEWS , MAIL, and BUGS

The user may communicate with the DATAPLOT Service

Group via the MESSAGE command. The form for the

MESSAGE command is

The BUGS command is a fourth way of communicating

with the user-community. The form of the BUGS

command is

MESSAGE message

If a message takes more than one line, then each

successive line should start with the same MESSAGE

command, as in

BUGS

This will print out a list of known bugs (if any)

of the local implementation, and suggested code

corrections to circumvent such bugs.

MESSAGE What is the easiest way to do

MESSAGE dynamic, color, 3d rotation?

MESSAGE Bill Martingale , extension 3365

Note that the message should contain the name of

the user, along with other contact information

such as phone and room number. This message will

be inserted into a message file which the DATAPLOT

Service Group will peruse on a regular basis, and

respond accordingly.

There are 4 ways in which the DATAPLOT Service

Group can communicate with a user—

1) via the sign-on message;

2) via the NEWS command;

3) via the MAIL command;

4) via the BUGS command.

There is 1 way in which the user can communicate

to the Dataplot Service Group—

5 ) via the MESSAGE command.

The sign-on message appears whenever any user signs onto DATAPLOT. It contains important

current information, and is usually short and to the point.

Details regarding current DATAPLOT developments

may be evoked by the analyst entering the NEWS

command, as in

NEWS

This will print out more detailed information

regarding topics of current interest .

The DATAPLOT Service Group communicates directly

to an individual user by use of the MAIL command.

For example, suppose the Service Group wished to inform user John Smith that the chunk of code that

he desired has been written. This is done by

using the sign-on message to inform John Smith

that he has mail, and then allowing John Smith to enter the MAIL command, as in

MAIL SMITH

which will in turn print out the detailed mail

message that the DATAPLOT Service Group had

constructed

.

i
6-35

DATAPLOT File Information for Implementation

The following information is of interest only to the local DATAPLOT Service Group and may be

skipped over by the general reader.

The file which contains the desired sign-on

message is named DPMESF and has unit number 21 attached to it. The first line image of the file

consists of a floating point number which is the

number of lines actually contained by the message.

Such lines follow immediately after the first

line. For example, DPMESF might consist of the

following 3 lines —

2.New developments —Looping, Conditionality , and

Variable Printing . Use NEWS command for details

If no message is to be printed out, then the file

DPMESF should have the first line consisting of

merely a 0. on it.

The file which contains the desired news is named

DPNEWF and has the unit number 22 attached to it.

The structure cf this file is the same as the

message file— namely, a first line consisting of

a floating point number defining the number of

lines of the news, and succeeding lines which

actually consist of the news, for example,

4.The general form of the LOOP command is

LOOP FOR parameter name = start increment stop

To terminate the loop, use the

END OF LOOP command.

The file which contains the desired bug

information is named DPBUGF amd has the unit

number 25 attached to it. The structure is as before—a leading line image with the number of

lines of bug information, and successive line

images containing the actual bug information, as

jjiin

2.TIC COORDINATES command not working.

DOUBLE PRECISION command not working.

The file which contains the desired mail

information is named DPMAIF and has unit number 23

attached to it. Since mail can exist for several

users simultaneously in the file, a different

structure has been used— to enter the mail for

Carter, say, the DATAPLOT Service Group enters

(via the local editor) a line image in the file

which consists only of the 6 characters CARTER.

The following line images consist of the mail

message. The message is terminated whenever a line image is encountered which consists of at

least 5 hyphens in a row. Such a line image is

, deliberately entered into the file in order to

I terminate a mail message and to separate such a mail message from the mail message to another

user. For example,

MAIL CARTER

3/3/83

The desired code is

CHARACTERS X BLANK

LINES BLANK SOLID

PLOT Y PRED VERSUS X PLOT RES X NORMAL PROBABILITY PLOT RES

If the mail file has multiple pieces of mail for

the same user, then only the first mail message is

accessed . Thus the analyst should add new mail

to the beginning of the file and may thus have a permanent record of all mail since old mail

messages will be shunted off toward the back (end)

of the file.

The MESSAGE file is named DPQUEF and has unit

designation 26. Every entry which the analyst

enters via the MESSAGE command gets copied

character by character out to this file. Most

recent entries are placed at the beginning of the

file.
6-36

A summary of the DATAPLOT file/subfile structure

is as follows —

Purpose Unit Number Name File or Subfile Command

Message

News

Mail

Help

Bug

Query

Log

212223

24252627

DPMESF

DPNEWF

DPMAIF

DPHELF

DPBUGF

DPQUEF

DPLOGF

file only

file only

file only

file only

file only

file only

off

MESSAGE

NEWS

MAIL

HELP

BUG

QUERY

Read

Write

Macro

Save

31 user-defined

32 user-defined

33, 35-40 user-defined

34 user-defined

file or subfile

file or subfile

file or subfile

file or subfile

READ and SERIAL READ

WRITE

CREATE and CALL

SAVE and RESTORE

Scratch

Data

Plot

Plot 2

41

4 2 4344

DPSCRF

DPDATF

DPPL1F

DPPL2F

file only

file only

file only

file only
Default Output Color Graphics

Device Settings TERMINAL , COLOR,

and PICTURE POINTS

Only the primary output device (the terminal ) is

on. All 4 secondary output devices are off. The

primary output device is a Tektronix 4014 (or

equivalent). The primary output device is

continuous, non-color, and has 1024 horizontal

picture points and 781 vertical picture points.

The penplotter is turned off. The automatic local

hardcopy is off. The Zeta , Calcomp, and Versatec

are off.

The default color status for DATAPLOT is off—

that is, DATAPLOT believes it is communicating

with a non-color terminal for its graphics. If one wishes to generate color graphics, then the

default device is the Tektronix 4027. To inform

DATAPLOT of this, the analyst must use the

TERMINAL command, as in

TERMINAL TEKTRONIX 4027

The message will come back that the primary output

device has been changed to the Tektronix 4027, the

color status has been changed to on, and the

picture points have been changed to 640

(horizontally) by 480 (vertically )

A second color terminal which DATAPLOT supports is

the RAMTEK 6211. To inform DATAPLOT that one is

running on such a terminal, one enters the

following—

TERMINAL RAMTEK 6211
6-38

Multiple Commands Per Line Specifying Post-Plot

TERMINATER CHARACTOR Cursor Position and Size

CURSOR SIZE

The vast majority of DATAPLOT programs have only

one command statement per line image. Such a style is conducive to readability . On occasions

,

however, the analyst may wish to have multiple

command statements per line. This is permitted by

use of the terminator character ( = a semicolon).

Anytime that DATAPLOT encounters a semicolon (or a carriage return) in a line image, it assumes that one command statement has terminated and the next

command statement is beginning

.

Although the default terminator character is the

semicolon, other terminator characters are

possible. The TERMINATOR CHARACTER command

specifies such a character , as in

TERMINATOR CHARACTOR !

which would replace the ; with a ! as a terminator character

.

The semicolon was chosen as the default terminator

character because its use otherwise in the usual

assortment of DATAPLOT command statements is rare. The only place where its inadvertent use might

arise is in the TITLE and ...LABEL statements—

one should be careful about the use of the

semicolon in such cases. If one wants a semicolon

as part of a title or label, then one should first

change the terminator character to something else,

otherwise the title or label will be

clipped and a syntax error will result.

Given that the semicolon is the terminator

character , then the following 2 programs are identical —

This section refers to the size of the cursor (and

the size of the characters ) when the terminal is not generating graphics , but rather is simply

receiving commands from the keyboard or is simply

printing out results from various non-graphics

DATAPLOT commands (such as FIT, ANOVA , SMOOTH,

LET, etc.) In such case, it is at times convenient

to be able to control the size of the characters

being printed. It is also convenient to have the cursor/character size at one setting for the

non-graphics , and perhaps at other settings for

the graphics. Thus after a plot is formed

(regardless of the size of the characters used in

the plot), it is preferable for the cursor/

characters to return to the non-graphics size.

In DATAPLOT this is controlled via the CURSOR SIZE

command. The default cursor/character size is 3 (= 3% of total screen height). To set the cursor size to 1.5, say, the analyst enters

CURSOR SIZE 1.5

The above comments apply only for those terminals

which have multiple cursor sizes. For those

terminals with only 1 size (e.g., Tektronix 4010,

and Tektronix 4025), that 1 size will, of course, appear regardless of the cursor size setting.

READ ABC. X Y PLOT Y X FIT Y = A+B*X+C*X**2

CHARACTERS X BLANK

LINES BLANK SOLID

PLOT Y PRED VERSUS X PLOT RES X NORMAL PROBABILITY PLOT RES

and

READ ABC. X Y ; PLOT Y X ; FIT Y = A+B*X+C*X* * 2

;

CHARACTERS X BLANK; LINES BLANK SOLID; PLOT Y PRED VERSUS X ; PLOT RES X; NORMAL PROBABILITY PLOT RES

The terminator character may be either included or excluded when it is the last character of a line

image. In lines 1 and 2 above, it was included

;

in line 3 above, it was omitted.
1 . Genera 1

2. Command Categories

3. Parameters, Variables, and Functions

4. Input/Output

5. Program Control

6 . Mi see 1 1 aneous

NBS-114A (rev. 2-8Q

U.S. DEPT. OF COMM. 1. PUBLICATION OR 2. Performing Organ. Report No. 3. Publication Date BIBLIOGRAPHIC DATA

RF PORT NO

SHEET (See instructions) NBS SP 667 June 1984

4. TITLE AND SUBTITLE

DATAPLOT—Introduction and Overview

5. AUTHOR(S)

James J. Filliben

6. PERFORMING ORGANIZATION (If joint or other than NBS, see instructions)

NATIONAL BUREAU OF STANDARDS

DEPARTMENT OF COMMERCE

WASHINGTON, D.C. 20234

7. Contract/Grant No.

8. Type of Report & Period Covered

Final

9. SPONSORING ORGANIZATION NAME AND COMPLETE ADDRESS (Street. City. State, ZIP)

Same as in item 6 above.

10. SUPPLEMENTARY NOTES

Library of Congress Catalog Card Number: 83-600598

7 Document describes a computer program; SF-185, FlPS Software Summary, is attached.

11. ABSTRACT (A 200-word or less factual summary of most significant information. If document includes a significant

bibliography or literature survey, mention it here)

This manual provides DATAPLOT code solution to a variety of commonly occurring

graphical problems. A line-by-line explanation of code is given, along with

illustrations and general discussion.

12. KEY WORDS (Six to twelve entries; alphabetical order; capitalize only proper names; and separate key words by semicolons)

computer software; data analysis; DATAPLOT; fitting; graphics; interactive fitting;

interactive graphics; interactive language; language; mathematics; non-linear fitting;

software; statistical methods.

13. AVAILABILITY

fxl Unlimited

[""J For Official Distribution.

[Y] Order From Superintendent of Documents, U.S. Government Printing Office, Washington, D.C. 20402.

Do Not Release to NTIS

7J Order From National Technical Information Service (NTIS), Springfield, VA. 22161

14. NO. OF

PRINTED PAGES

112

15. Price

USCOMM-DC 6043-PSO

NBS TECHNICAL PUBLICATIONS

PERIODICALS

JOURNAL OF RESEARCH—The Journal of Research of the National Bureau of Standards reports NBS research and develop- ment in those disciplines of the physical and engineering sciences in which the Bureau is active. These include physics, chemistry,

engineering, mathematics, and computer sciences. Papers cover a broad range of subjects, with major emphasis on measurement

methodology and the basic technology underlying standardization. Also included from time to time are survey articles on topics

closely related to the Bureau's technical and scientific programs. As a special service to subscribers each issue contains complete

citations to all recent Bureau publications in both NBS and non- NBS media. Issued six times a year. Annual subscription: domestic

$18: foreign $22.50. Single copy, $5.50 domestic; $6.90 foreign.

NONPERIODICALS

Monographs—Major contributions to the technical literature on

various subjects related to the Bureau's scientific and technical activities. Handbooks—Recommended codes of engineering and industrial practice (including safety codes) developed in cooperation with in- terested industries, professional organizations, and regulatory bodies

Special Publications—Include proceedings of conferences sponsored by NBS, NBS annual reports, and other special publications

appropriate to this grouping such as wall charts, pocket cards, and

bibliographies. Applied Mathematics Series—Mathematical tables, manuals, and

studies of special interest to physicists, engineers, chemists,

biologists, mathematicians, computer programmers, and others engaged in scientific and technical work.

National Standard Reference Data Series—Provides quantitative data on the physical and chemical properties of materials, compiled from the world's literature and critically evaluated. Developed under a worldwide program coordinated by NBS under

the authoritv of the National Standard Data Act (Public Law

90-396).

NOTE: The principal publication outlet for the foregoing data is the Journal of Physical and Chemical Reference Data (JPCRD)

published quarterly for NBS by the American Chemical Society

(ACS) and the American Institute of Physics (A1P). Subscriptions,

reprints, and supplements available from ACS, 1 155 Sixteenth St., NW, Washington, DC 20056.

Building Science Series—Disseminates technical ir formation developed at the Bureau on building materials, components,

systems, and whole structures. The series presents research results,

test methods, and performance criteria related to the structural and

environmental functions and the durability and safety characteristics of building elements and systems.

Technical Notes—Studies or reports which are complete in themselves but restrictive in their treatment of a subject. Analogous to monographs but not so comprehensive in scope or definitive in treatment of the subject area. Often serve as a vehicle for final reports of work performed at NBS under the sponsorship of other government agencies.

Voluntary Product Standards—Developed under procedures

published by the Department of Commerce in Part 10. Title 15, of

the Code of Federal Regulations. The standards establish nationally recognized requirements for products, and provide all concerned interests with a basis for common understanding of the

characteristics of the products. NBS administers this program as a supplement to the activities of the private sector standardizing

organizations. Consumer Information Series—Practical information, based on N BS research and experience, covering areas of interest to the con- sumer. Easily understandable language and illustrations provide

useful background knowledge for shopping in today's tech- nological marketplace. Order the above NBS publications from: Superintendent of Documents, Government Printing Office. Washington, DC 20402. Order the following NBS publications—FIPS and NBSIR's—from

the National Technical Information Service , Springfield, VA 22161

Federal Information Processing Standards Publications (FIPS

PUB)—Publications in this series collectively constitute the Federal Information Processing Standards Register. The Register

serves as the official source of information in the Federal Govern- ment regarding standards issued by NBS pursuant to the Federal Property and Administrative Services Act of 1949 as amended.

Public Law 89-306 (79 Stat. 1127), and as implemented by Executive Order 11717(38 FR 12315, dated May II, 1973) and Part 6

of Title 15 CFR (Code of Federal Regulations).

NBS Interagency Reports (NBSIR)—A special series of interim or

final reports on work performed by NBS for outside sponsors

(both government and non-government). In general, initial dis- tribution is handled by the sponsor; public distribution is by the National Technical Information Service , Springfield, VA 22161.

in paper copy or microfiche form.

N.
U.S. Department of Commerce

National Bureau of Standards

Washington, D C. 20234

Official Business

Penalty for Private Use S300