![]() |
| |
DATAPLOT Language Features |
|
Introduction |
DATAPLOT is an interactive high-level (free-format English-like
syntax) language with extensive capabilities in:
|
Specific Features | Specific features of the Dataplot language include: |
Programming With DATAPLOT | |
Sequential and Structured | 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. |
Low Level Commands | Like BASIC, FORTRAN, etc., DATAPLOT has a series of low-level commands which specify to the computer that certain elementary operations (such as readinq, writing, looping, etc.) should be carried out. |
High Level Commands | In addition, hovever, 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 tbe language can be used in a semi-interactive mode (running pre-stored programs at a terminal), and a batch mode (running pre-stored programs with remote output on the batch high-speed printer), it was primarily designed for, and is most effectively used in, an interactive environment. |
Dataplot Programs Typically Short | Because of the existence of commonly-used 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 are Format Free | Input and output in DATAPLOT is format-free. The READ and SERIAL READ command enter data into DATAPLOT, the WRITE (with PRINT as a synonyn) command allows the writing of data to the terminal screen or to an external file. |
Several Hundred Commands | The DATAPLOT command vocabulary consists of several hundred commands. The analyst may use any command at any time. A given program for a given application typically makes use of a small subset of DATAPLOT commands (10 to 15 commands). |
Three Most Important Commands | The 3 most important DATAPLOT commands are PLOT, FIT, and LET. Other commonly-used commands are CHARACTERS, LINES, TITLE, ...LABEL (as in YLABEL, X1ABEL, X2LABEL, and X3LABEL), FONT, TEXT, ECHO, READ, WRITE, and STATUS. |
Spaces are the Universal Separator in Dataplot |
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
|
English-Synatax Language | |
Commands Have English Language Names |
DATAPLOT is an English-syntax language. Many of the command
statements are identical to their English-language
counterparts. For example,
FIT HISTOGRAM NORMAL PROBABILITY PLOT ANOVA SMOOTH BOX PLOT |
Examples of English Like Syntax |
Thus to generate a plot of the function sin(x)/x for the
values starting with x = 0.1, at increments of 0.2, and
ending vith x = 12, one would enter
|
Dataplot Programs Easy to Write | 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 | |
Columns 1 to 80 | Command statements appear free-format in columns 1 to 80 of a program line. |
Space Used as Separator Between Command Components |
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 interva1 of x values starting with x = -3, at
increments of 0.1, and ending with x = +3, the following is
incorrect:
|
Packing of Characters Permitted in Functions |
Packing of characters is permitted only in defining and using
functions. Thus
|
One Continuation Line Allowed |
If command statements are longrer than 80 characters, then
they may be extended onto the next line by appending ... at
the end of the first line, as in
FOR B = 1 .1 2 FOR C = .5 .01 .6 |
Declaration-Free Language | |
Supported Types in Dataplot |
The data types supported in the
Dataplot language are
|
Rules for Names | Names used for parameters, variables, matrices, and functions can be up to eight 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 can be used, but only the first eight characters are scanned and internal1y stored. |
Declaration Free Language | DATAPLOT is a declaration-free language. One need not pre-define parameter, variable, matrix, 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. |
DELETE First to Change Type | Once a name is defined (as a parameter, a variable, a matrix, or a function), it remains that type throughout the DATAPLOT run. For exanple, if X is used as a variable, it will remain a variable 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 using the DELETE command (as in DELETE X), and then reuse the name in the desired fashion. |
Structured Language | |
Program Execution Flows from Top to Bottom | 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 commnands, 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. |
Subprograms Initiated with CALL Command |
Branching within a (sub)program is not permitted;
branching between subprograms can be done via the
CALL command, as in
|
Punctuation | |
Spaces are Universal Separator in Dataplot | 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 |
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; vhen in doubt, leave a space rather
than a comma. Blanks and spaces within
mathematica1 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) |
Command Statements are Free Format | 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. |
No Punctuation in Data Files | 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 be ignored by DATAPLOT. DATAPLOT also converts non-printing characters (e.g., tab characters) in command lines and data files to spaces (this is not true in earlier versions of DATAPLOT). |
Restricting Rows and Columns When Reading Data Files |
Alphabetic information at the beginning of a data file can
be skipped over using the
SKIP command. For example,
The ROW LIMITS command allows the analyst to focus only on specified line images of a file, as in
|
Main Menu | |
Components of the Dataplot Language | The DATAPLOT language consists of the following components: |
Privacy
Policy/Security Notice
NIST is an agency of the U.S. Commerce Department.
Date created: 06/05/2001 |