Personal tools
You are here: Home Documentation Users Guide Appendix B: PPLUS Guide PPLUS COMMAND FILES
Document Actions

PPLUS COMMAND FILES

by Catherine Nunkai — last modified 2011-10-05 16:52

Appendix B Sec7

PPLUS COMMAND FILES


Appendix B Sec7.1

INTRODUCTION

PPLUS can be run using a PPLUS command file that contains the same commands used by PPLUS interactively. The file can have any name or extension, but the default extension is .PPC. To run a PPLUS command file named CMD.PPC, you can enter PPLUS by typing PPLUS CMD.PPC in response to the VAX/VMS prompt, or you can enter PPLUS in the usual way and give the PPLUS command @CMD.PPC. (See @ in the chapter on Command Description.)

Each time PPLUS is used, an echo file (named ECHO.DAT by default) is generated. This file can be edited (it should be renamed) with any VAX text editor and used as a PPLUS command file in subsequent PPLUS sessions.


Appendix B Sec7.2

SYMBOL SUBSTITUTION

PPLUS allows symbol substitution in a manner similar to VAX/VMS symbols. Global and local symbols are supported in conjunction with nested command files and parameter passing. The SET and SHOW commands create, modify and list the symbols. When initially entering PPLUS (i.e., at the first command level) the symbols are global and available to all command levels. At each subsequent command level, local symbols are created and used by default. Global symbols are used when no local symbol exists. If the symbol name is preceded by a star (*), the global symbol will be created, modified or substituted.

Parameters passed via the @ command line are named P1, P2, P3, etc... just as they are in VAX/VMS. Symbols are recognized by PPLUS by being enclosed by single quotes. Character strings can be enclosed in double quotes. For example:

SET TEMP "This is a test label"
XLAB 'temp'

will have the same effect as:

XLAB This is a test label

Several symbols are predefined. 'DATE' and 'TIME' contain the current date and time. Date and time formats are dd-mmm-yy and hh:mm:ss. In addition, P1 through Pn are also predefined if the corresponding argument was passed via the @ command. For example, the command procedure PLOTIT.PPC could be executed in PPLUS by typing @PLOTIT 110W Temperature. Then in the procedure PLOTIT, the symbol P1 will have the value "110W" and the symbol P2 will have the value "Temperature".

Symbols can also be defined and used in an array format, i.e., 'P(3)' will get symbol P3 and 'label(12)' will access symbol LABEL12.

To have a single quote (') in the symbol or command line two single quotes must be used (''). To have a double quote (") in the command line two double quotes ("") are required.

Here is a sample PPLUS command file which demonstrates some of the new, powerful PPLUS features. In this example, the symbol P1 has the value 110W.

pltnme,'p1'.plt
format,(f5.0,15x,f15.0)
vars,1,1,2
skp,1,'p1'.dat
rd,60
debug,on
show p1
debug,off
plot,@TRMonthly data 1979-83 at 'P1' ('date' 'time')

The proceeding PPLUS command file (named PLOTIT.PPC) could be called repeatedly in PPLUS for different data files named 110W.DAT, 140W.DAT, etc. by entering the PPLUS commands @PLOTIT 110W, @PLOTIT 140W, etc. The resulting plot files, ECHO.DAT files and graphs would be identified by the data file names of 110W, 140W, etc. The graph title will also include the time and date when the graph was made.


Appendix B Sec7.3

GENERAL GLOBAL SYMBOLS

The global symbols set by PPLUS to allow information to be available in the command procedure are:

SYMBOL

COMMAND

DESCRIPTION

DATE

The current date dd-mmm-yy

PPL$COMMAND_FILE

@

The current command file name.

PPL$EOF

RD,RWD,SKP

"YES" if an EOF was read.

PPL$FORMAT

FORMAT

The current format.

PPL$HEIGHT

SIZE

Height of the box.

PPL$INPUT_FILE

RD,SKP,RWD

The current input file.

PPL$LF_A

LINFIT

Constant from fit y= a + b*x

PPL$LF_A_STDEV

LINFIT

Standard error of A.

PPL$LF_B

LINFIT

Constant from fit.

PPL$LF_B_STDEV

LINFIT

Standard error of B.

PPL$LF_R2

LINFIT

Regression coefficient squared.

PPL$LF_RES_VAR

LINFIT

Residual variance.

PPL$LF_VAR

LINFIT

Total variance.

PPL$LINE_COUNT

-

The number of the last line read.

PPL$PLTNME

PLTNME

The name of the plot file.

PPL$RANGE_INC

%RANGE

See Advanced Commands Chapter

PPL$RANGE_HIGH

%RANGE See

Advanced Commands Chapter

PPL$RANGE_LOW

%RANGE

See Advanced Commands Chapter

PPL$TEKNME

TEKNME

The name of the tektronix file.

PPL$VIEW_X

VPOINT

X viewpoint

PPL$VIEW_Y

VPOINT

Y viewpoint

PPL$VIEW_Z

VPOINT

Z viewpoint

PPL$WIDTH

SIZE

Width of the box.

PPL$XFACT(n)

TRANSXY

Xfact for line n.

PPL$XLEN

AXLEN

Length of X axis.

PPL$XOFF(n)

TRANSXY

Xoff for line n.

PPL$XORG

ORIGIN

Distance between origin and left edge.

PPL$XFIRST(n)

-

X value for first data point in line n.

PPL$XLAST(n)

-

X value for last data point in line n.

PPL$XMAX

RD

Xmax of contour grid

PPL$XMIN

RD

Xmin of contour grid

PPL$XMAX(n)

-

Xmax for valid data in line n.

PPL$XMIN(n)

-

Xmin for valid data in line n.

PPL$YFACT(n)

TRANSXY

Yfact for line n.

PPL$YLEN

AXLEN

Length of Y axis.

PPL$YOFF(n)

TRANSXY

Yoff for line n.

PPL$YORG

ORIGIN

Distance between origin and bottom edge.

PPL$YFIRST(n)

-

Y value for first data point in line n.

PPL$YLAST(n)

-

Y value for last data point in line n.

PPL$YMAX

RD

Ymax of contour grid

PPL$YMIN

RD

Ymin of contour grid

PPL$YMAX(n)

-

Ymax for valid data in line n.

PPL$YMIN(n)

-

Ymin for valid data in line n.

PPL$ZMAX

-

Zmax for valid contour data.

PPL$ZMIN

-

Zmin for valid contour data.

TIME

-

The current time hh:mm:ss



Appendix B Sec7.4

EPIC GLOBAL SYMBOLS


The following global symbols set by PPLUS contain information from EPIC time series data headers:

SYMBOL COMMAND DESCRIPTION


PPL$EPIC_COMMENT_DATA(n) RD Data comment from header.

PPL$EPIC_COMMENT_FIRST(n) RD Data comment from header.

PPL$EPIC_COMMENT_SECOND(n) RD Data comment from header.

PPL$EPIC_DEPTH(n) RD Depth of measurement.

PPL$EPIC_DESCRIPT(n) RD EPIC series descriptor.

PPL$EPIC_EXPERIMENT(n) RD Experiment identifier.

PPL$EPIC_LATITUDE(n) RD Latitude.

PPL$EPIC_LONGITUDE(n) RD Longitude.

PPL$EPIC_MOORING(n) RD Mooring identifier.

PPL$EPIC_PROJECT(n) RD Project identifier.

PPL$EPIC_XLAB(n) RD X-axis label.

PPL$EPIC_YLAB(n) RD Y-axis label.

The following global symbols set by PPLUS contain information from EPIC CTD data headers:

SYMBOL COMMAND DESCRIPTION


PPL$EPIC_CAST(n) RD CTD Cruise and Cast identifier

PPL$EPIC_COMMENT_FIRST(n) RD Data comment from header.

PPL$EPIC_COMMENT_SECOND(n) RD Data comment from header.

PPL$EPIC_DATE(n) RD CTD Cast Date (GMT)

PPL$EPIC_LATITUDE(n) RD Latitude.

PPL$EPIC_LONGITUDE(n) RD Longitude.

PPL$EPIC_XLAB(n) RD X-axis label.

PPL$EPIC_YLAB(n) RD Y-axis label.

The following global symbol set by PPLUS contains information about the EPIC data file:

SYMBOL COMMAND DESCRIPTION

PPL$EPIC_DATAFILE(n) RD Data file name

PPL$INPUT_FILE RD EPIC/pointer file



Appendix B Sec7.5

COMMAND FILE LOGIC

There are several commands that enable the user to make command files more like small programs. These commands are similar to FORTRAN's block IF and C's WHILE loops. Commands have been introduced that enable the user to increment and decrement a counter stored in a symbol by one. In order to make command files more readable leading blanks and tabs are ignored.

The syntax for the PPLUS commands is given in the Command Description chapter.

EXAMPLES:

In this example, PPLUS is exited when an end-of-file is encountered by the RD command. This illustrates both the block IF and the use of the global PPLUS symbol PPL$EOF.

RD

IF PPL$EOF .EQ. "YES" THEN

EXIT

ENDIF

In the following example, the size of the plot is set to val by val inches if the value of the symbol val is less than or equal to 13 otherwise the size is set to 13 x 13.

IF VAL .LE. 13 THEN

SIZE 'VAL' 'VAL'

ELSE

SIZE 13 13

ENDIF

In the next example, if P1 is null then P1 is set to TEMPORARY.PLT and then the plot name is set to the value of the symbol P1.


IF P1 .EQ. "" THEN

SET P1 TEMPORARY.PLT

ENDIF

PLTNME 'P1'

This WHILE loop results in 10 plots of 100 points each from data file DLDK1039.DAT. (PPL$LINE_COUNT is a PPLUS defined symbol for the sequence number of the last data line read.)

SKP,DLKD1039.DAT

WHILE PPL$LINE_COUNT .LE. 10 THEN

RD,100

PLOT

ENDW



Appendix B Sec7.6

ARITHMETIC

Simple arithmetic can be performed using PPLUS symbols. The commands that perform these function are SET, INC and DEC. The INC and DEC functions are primarily used to increment and decrement counters in WHILE loops. The following WHILE loop uses the counter to set the line type to a solid line for each line to be plotted (PPL$LINE_COUNT is a PPLUS defined symbol for the number of the last data line read):

SET COUNT 1

WHILE COUNT .LE. PPL$LINE_COUNT THEN

LINE,'COUNT',,0

INC COUNT

ENDW

The SET command can be used to perform simple arithmetic on PPLUS symbols. The syntax for these arithmetic expressions have the form:

num1 op num2,

where op is +, -, * or / (addition, subtraction, multiplication or division) and num1 and num2 are numbers. The numeric values must be separated from the operator op by spaces. The string will be used exactly as it appears if enclosed by double quotes ("). The following example centers a moveable label 0.5 inches above the top axis (PPL$XLEN and PPL$YLEN are PPLUS symbols for the X and Y axis lengths):

SET XPOS 'PPL$XLEN' / 2.0

SET YPOS 'PPL$YLEN' + 0.5

LABS/NOUSER,1,'XPOS','YPOS',0,"A centered label"



Appendix B Sec7.7

SYMBOL ARRAYS

As described in the SYMBOL SUBSTITUTION section, PPLUS symbols can be defined and used as arrays. There are several general PPLUS global symbols which are also defined as arrays, such as PPL$XLAST(n) and PPL$YLAST(n), the last x and y values for data line n. The array index, in parentheses, can be either a number or a PPLUS symbol. Examples will illustrate this.

The following piece of a PPLUS command file uses moveable lables to write the line number to the right of the last point plotted for the last line read in. It uses the global PPLUS symbols PPL$XLAST(n), PPL$YLAST(n) and PPL$LINE_COUNT.

SET XPOS 'PPL$XLAST(PPL$LINE_COUNT)'

SET YPOS 'PPL$YLAST(PPL$LINE_COUNT)'

LABS 'PPL$LINE_COUNT','XPOS','YPOS',-1,'PPL$LINE_COUNT'

The array index can also be a user defined symbol. In the following example, the array MON contains the names of the first 3 months of the year. The graph title will be "Daily Values for the Month of FEBRUARY".

set mon(1) "JANUARY"

set mon(2) "FEBRUARY

set mon(3) "MARCH"

.

.

.

set count 2

.

.

.

plot,"Daily Values for the Month of 'mon(count)'


The index of an array (inside parentheses) will be interpreted according to the following rules: 1) if it is a number, that number will be used as the array index, 2) if it is not a number, it will be interpreted as a symbol, 3) if it is in single quotes, it will be interpreted as a symbol.


Appendix B Sec7.8

SPECIAL FUNCTIONS

The functions described in this sections are all accessed with the SET command. They can be accessed only with the SET command. The functions enable string manipulation and formatting within PPLUS symbol values. The PPLUS functions are similar to some of the VAX/VMS lexical functions.

The general syntax is :

SET sym $function (arg1, arg2,...),

where "sym" is the symbol set by the function and "function" is the name of the PPLUS function. PPLUS functions and their arguments are described in the following sections. Where function arguments are indicated as symbols, they must be PPLUS symbols and cannot be strings. Where function arguments are indicated as strings, they can be enclosed in double quotes.


Appendix B Sec7.8.1

$EDIT

The command is :

SET sym_out $EDIT (sym_in, arg1 [ arg2 arg3...] )

where:

sym_out = symbol set by the function

sym_in = symbol on which function is to work

arg1 = UPCASE - changes string in sym_in to upper case
= TRIM - trims leading and trailing blanks from sym_in
= COMPRESS - removes extra blanks from sym_in (reduces each group of blanks to a single blank)
= COLLAPSE - removes all blanks from sym_in

If multiple arguments are used, they can be separated by blanks, e.g., SET sym $EDIT(sym_in,UPCASE COLLAPSE). If commas are used as separaters, the entire set of arguments must be enclosed in quotes, e.g.,
SET sym $EDIT(sym_in,"UPCASE,COLLAPSE").

Example:

SET S1 "depth"

SET S2 $EDIT (S1,UPCASE)

This results in S2 having the value "DEPTH".

Example:

SET S1 " depth "

SET S2 $EDIT (S2,UPCASE TRIM)

This results in S2 having the value "DEPTH".


Appendix B Sec7.8.2

$EXTRACT

This function extracts selected characters from the input string. The first character in the string is in position 1. The command is :

SET sym_out $EXTRACT (start,length,sym_in)

where:

sym_out = symbol set by the function

start = starting character position

length = length of character string to be extracted

sym_in = symbol on which function is to work

Example:

SET S1 "February"
SET S2 $EXTRACT(1,3,S1)

This results in S2 having the value "Feb".


Appendix B Sec7.8.3

$INTEGER

This function converts a number to integer format. The command is :

SET sym_out $INTEGER (sym_in)

where:

sym_out = symbol set by the function

sym_in = symbol on which function is to work

Example:

SET MON 1
.
.
INC MON
SET INT_MON $INTEGER(MON)

In this example, the symbol MON has been incremented, and will have the value "2.00". The symbol INT_MON will have the value "2".


Appendix B Sec7.8.4

$LENGTH

This function returns the length of the input string. The command is :

SET sym_out $LENGTH (sym_in)

where:

sym_out = symbol set by the function

sym_in = symbol on which function is to work

Example:

SET S1 "February"
SET S2 $LENGTH(S1)

This results in S2 having the value "8".


Appendix B Sec7.8.5

$LOCATE

[This function is deprecated; see the Ferret function SUBSTRING] This function locates a substring in the input string. The first character in the string is in position 1. The command is :

SET sym_out $LOCATE (substrg,sym_in)

where:

sym_out = symbol set by the function

substrg = string to be located. The first 30 characters of this string are compared with sym_in.

sym_in = symbol function on which function is to work

Example:

SET S1 "JAN 21,1987"
SET S2 $LOCATE(",",S1)

This results in S2 having the value "7".


Appendix B Sec7.8.6

$ELEMENT

This function extracts an element from an input string in which the elements are separated by a specified delimiter. The command is :

SET sym_out $ELEMENT (pos,delim,sym_in)

where:

sym_out = symbol set by the function

pos = position of element to be extracted

delim = delimiter

sym_in = symbol on which function is to work

Example:

SET MONTH "JAN/FEB/MAR/APR/MAY/JUN/JUL"
SET MON $ELEMENT(3,"/",MONTH)

This results in MON having the value "MAR".

Example:

SET MONTH "JAN/FEB/MAR/APR/MAY/JUN/JUL"
SET COUNT 1
WHILE COUNT .LE. 7 THEN
SET MON(COUNT) $ELEMENT('COUNT',"/",MONTH)
INC COUNT
ENDW

This results in MON(1) = "JAN", MON(2) = "FEB", MON(3) = "MAR", MON(4) = "APR", MON(5) = "MAY", MON(6) = "JUN", MON(7) = "JUL".


Appendix B Sec7.9

LABELS


Appendix B Sec7.9.1

AXIS LABELING

Commands affecting the labeling of the axes are:

XAXIS

Controls numeric labeling and tics on the x-axis.

YAXIS

Controls numeric labeling and tics on the y-axis.

AXATIC

Sets number of large tics automatically for x and y.

AXLABP

Locates axis labels at top/bottom or left/right of plot.

AXLEN

Sets axis lengths.

AXLINT

Sets label interval for axes.

AXLSZE

Sets axis label heights.

AXNMTC

Sets number of small tics between large tics on axes.

AXNSIG

Sets no. significant digits in numeric axis labels (auto only).

AXSET

Allows omission of plotting of any axis.

AXTYPE

Sets axis type for x- and y-axis.

XFOR

Sets format of x-axis numeric labels.

YFOR

Sets format of y-axis numeric labels.

XLAB

Sets label of x-axis.

YLAB

Sets label of y-axis.

The numeric axis labels are drawn such that zero will be labelled if it occurs between the low and high axis limits. If zero does not occur, then the first large tic (from the bottom or left) will be labelled. The large tics are forced to occur at integer multiples of the tic interval.


Appendix B Sec7.9.2

EMBEDDED STRING COMMANDS

Fonts

All labels in PPLUS can be plotted using any one of 21 character fonts and 11 symbol fonts. The default font is SR (Simplex Roman) and other fonts are called by preceding their two letter abbreviation by an @, i.e., @CI for complex itallic.

Symbol fonts are called by using the symbol number, i.e., @MA01 plots the first symbol in MATH and @MA12 will plot the twelfth symbol. Font changes (of the form @XX) can be imbedded in any label string (e.g., XLAB, YLAB, PLOT commands).

@font selects "font" as the character or symbol font to be used, where the font abbreviations are listed below.

Character Fonts

Tables showing the character fonts

SR

Simplex Roman (default)

DR

Duplex Roman

TR

Triplex Roman

CR

Complex Roman

AS

ASCII Simplex Roman

AC

ASCII Complex Roman

CS

Complex Script

TI

Triplex Italic

GE

Gothic English

IR

Indexical complex Roman

SS

Simplex Script

CI

Complex Italic

II

Indexical complex Italic

SG

Simplex Greek

CG

Complex Greek

IG

Indexical complex Greek

GG

Gothic German

GI

Gothic Italian

CC

Complex Cyrillic

AR

Cartographic Roman

AG

Cartographic Greek

Symbol Fonts

Tables showing the symbol fonts are here

ZO

Zodiac

MU

Music

EL

Electrical

WE

Weather

MA

Math

SM

Simplex Math

MP

Map

LM

Large Math

IZ

Indexical Zodiac

IM

Indexical Math

CA

Cartographic

A clear font command @CL is available to change the default font. The next font called after a @CL becomes the new default font. The font is reset to the default at the start of each label. The command DFLTFNT can also be used to change the default font to one of your choice.

Tables showing the symbol fonts are at

http://ferret.pmel.noaa.gov/Ferret/Documentation/Users_Guide/current/ppl_symbol_fonts.htm

Control characters for the two ASCII fonts AS and AC must be preceded by an <ESC> (ascii code=27). For example, to superscript while using the ASCII fonts you must have <ESC> in the label preceed the character to superscript.


Appendix B Sec7.9.3

Pen Selection

The pen may also be selected by giving the change pen command @Pn, where n is the character 1-9 and A-G. This allows the selection of up to 16 pens/colors. The color and font is reset to the default font and previous color after the character string is drawn. The PEN command can be used to change the default color by typing PEN,0,default_color.

If you need to select a color index beyond the range of P1 through PG, you can use the change color command @Cnnn where "nnn" is a 3-digit color index. (It must be 3 digits.)


Appendix B Sec7.9.4

Character Slant

The slant used in drawing the fonts may be changed by using the command @Zn, where n is the character 0-9 and A-G. This allows the selection of slant angles from 0 to 45 in 16 increments. The slant is reset to zero after the character string is drawn.


Appendix B Sec7.9.5

Subscripting, Superscripting And Back Spacing

An ^ (up arrow) imbedded in any label string will cause the next character to be drawn superscripted, an _ (underscore) will draw it subscripted, and a \ (backslash) backspaces over the last character drawn. The control characters ^, _ and \ are available in the two ASCII fonts AS and AC by preceding the control character by an <ESC> (ASCII code=27). For example, to subscript while using the ASCII fonts you must have <ESC>_ in the label preceed the character to subscript.


Appendix B Sec7.10

DATA FORMATS


Appendix B Sec7.10.1

SEQUENTIAL FORMATS

The format to be used in reading from a sequential file is defined by the commands FORMAT, VARS, and RD. Some definitions are useful:

NVAR - the number of variables per group

NGRP - the number of groups per record

NREC - the total number of records

For example, if the data consists of depth, u, v, t and the format is 8F10.2 (the format statement must be for an entire record) with two groups per record, the data would look like

D U V T D U V T

and NGRP=2, NVAR=4.

If you wanted to plot D as the Y variable, T as the X then, FORMAT (8F10.2) would be the correct FORMAT command and VARS,2,2,,,1 would be the correct VARS command. (U and V are not read or plotted.)

However, if the format was F10.2,30X,2F10.2,30X,F10.2 then FORMAT (F10.2,30X,2F10.2,30X,F10.2) and VARS,2,2,1 would be appropriate.

If the data is unformatted the meanings of NVAR and NGRP are unchanged. Unformatted data is specified by the FORMAT command FORMAT,UNF.

Reading will automatically stop at the end of the file and properly store the data.


Appendix B Sec7.10.2

BIBO FORMAT

The BIBO data format consists of data files created using the DSF routines and a 145 word header in the BIBO format. This data format is in the standard dsf file format for data storage.


Appendix B Sec7.10.3

EPIC FORMAT

This is the standard format for data from the EPIC data base. The data files are binary sequential files with at least one header of 8 80-character lines followed by data records with 1 data scan per record. When the FORMAT,EPIC command is used, the file name specified with the RD, SKP and RWD commands refers to the EPIC or pointer file. Variables to be read are specified with the EVAR command. Both time series EPIC data files and CTD EPIC data files are recognized by PPLUS. The /CTD qualifier on the FORMAT command tells PPLUS which type of EPIC data is being read.


Appendix B Sec7.10.4

DSF FORMAT

This data format is that produced by the DSF routines with the header and data in PPLUS format. The format must be followed to ensure that PPLUS can interpret the data file read correctly.

A single data file consists of a single header record and any number of data records followed by an EOF. The header must be either an array or other sequentially organized data set of 38 real variables. Below is the expected format.

INT WORD DESCRIPTION

1 XPTS

3 ZMIN first four created by CLSDSF

5 ZMAX

7 ZMEAN

9 XMIN minimum x value (real)

11 XMAX maximum x value (real)

13 KX number of x grid points (integer*4)

15 YMIN minimum y value (real)

17 YMAX maximum y value (real)

19 KY number of y grid points (integer*4)

21 ITYPE data type 0= 2-d set, 1= 1-d set (integer*4)

23-38 LAB(16) main label hollerith (integer*2)

39 NCH number of characters is LAB (integer*4)


41-56 IXLAB(16) x axis label hollerith (integer*2)

57 NXLB number of characters in IXLAB (integer*4)

59-74 IYLAB(16) y axis label hollerith (integer*2)

75 NYLB number of characters in IYLAB (integer*4)

All labels use SYMBEL to generate the plotted characters. The labels are optional, but if not used they should contain blanks.

ITYPE=0

Data must be stored in a linear array as:

Z(1,1),Z(2,1),...,Z(KX,1),Z(1,2),...,...,Z(KX,KY)

or as a 2-d array where the array is dimensioned as KX,KY.

Assuming the following arrays exist, ITYPE=0 data can be created as follows: HEAD(38),Z(25,50) NOTE: use EQUIVALENCE to set the integers in the real array.

CALL OPNDSF(file_name,'WR',ILUN)

CALL WRHDSF(ILUN,38,HEAD)

CALL WRDDSF(ILUN,1250,Z)

CALL CLSDSF(ILUN)

where file_name is the file name and ILUN is the logical unit to be used.

ITYPE=1

Data must be stored as a linear array as:

X(1),X(2),...,X(KX),Y(1),Y(2),...,Y(KX)

in this case KX= length of the series and KY must be set to 1, there must be KX of each X and Y in the data set. Given,

HEAD(38),X(200),Y(200) KX=100 then,

CALL OPNDSF(file_name,'WR',ILUN)

CALL WRHDSF(ILUN,38,HEAD)

CALL WRDDSF(ILUN,KX,X)

CALL WRDDSF(ILUN,KX,Y)

CALL CLSDSF(ILUN)

where KX is the number of pairs. The DSF routines are available in a user library by Task building with

DISK1:[DENBO.PPL]OURLIB/LIB.


Appendix B Sec7.11

ADVANCED COMMANDS

This section describes PPLUS primitive plot commands. With these commands, the user can make a plot with several x- or y-axes. The location of each axis can be specified. To distinguish them from the standard PPLUS commands, these commands all begin with "%".

These % commands can be entered only from a PPLUS command file, and can not be entered interactively from the keyboard. Each command is implemented as it is read from the command file.

Specifically, when the %XAXIS command is read from a command file, an x-axis is immediately drawn on the graph. By contrast, the standard PPLUS XAXIS command simply sets x-axis parameters and the x-axis is not drawn on the graph until a plotting command such as PLOT is issued. The % commands give the user great control over the graphics display, but must be used carefully. No PPLUS error messages are issued for illegal % commands. The % commands can not be used with the MULTPLT command. See the notes with each command description and the example at the end of this chapter.

Command descriptions follow.


Appendix B Sec7.11.1

%OPNPLT/qualifier

Opens the plot by putting the terminal into and out of graphics mode and setting /QUIET.

Valid qualifiers are:

/[NO]OVERLAY Controls whether PPLUS overlays the plot on the preceeding plot. The default is /OVERLAY which causes the plot to be overlaid without erasing the last plot.


Appendix B Sec7.11.2

%CLSPLT/qualifiers

Closes the plot by putting the terminal out of graphics mode and restoring /QUIET or /NOQUIET, whichever was in effect when the %OPNPLT command was issued.

Valid qualifiers are:

/[NO]WAIT

Controls whether PPLUS pauses after plot completion. Pause is signaled by a tone and terminated by typing a character. If an <ESC> is typed PPLUS will return from the current command level to the lowest command level. Default = WAIT.


Appendix B Sec7.11.3

%PLTLIN,n

Plots the n-th data line. Each RD command increments the data line count by 1. Use of the standard plotting commands (PLOT, PLOTUV, PLOTV, CONTOUR, VECTOR, and VIEW) resets the data line count. The %PLTLIN command does not reset the data line count. (WINDOW works.)

n Plot line n using current scale factors.


Appendix B Sec7.11.4

%LABEL/qualifier,x,y,ipos,ang,chsiz,label

Draws a label similar to a moveable label (LABS command). There is no label number and the label is drawn as soon as the command is read from the command file. Any number of labels may be drawn.

x

x position user or inches

y

y position user or inches

ipos

-1 left, 0 center, +1 right justify

ang

Angle at which lable is to o be drawn. (0 degrees is at 3 o'clock and positive rotation is counter clockwise.)

chsize

character size (inches)

label

character string to draw

Valid qualifiers are:

/[NO]USER determines units of x and y positions. Default is /USER. If /NOUSER units are inches from the ORIGIN. (see the ORIGIN command)


Appendix B Sec7.11.5

%RANGE,min,max,ntic

Finds axis limits for use with the %XAXIS and %YAXIS commands given the data extrema of min and max. The axis limits and tic interval are returned in the PPLUS symbols PPL$RANGE_LOW, PPL$RANGE_HIGH, and PPL$RANGE_INC.

min

minimum value of data to be ranged. Can use PPL$XMIN(n) or PPL$YMIN(n).

max

maximum value of data Can use PPL$XMAX(n) or PPL$YMAX(n).

ntic

number of large increments



PPL$RANGE_LOW

new minimum range value

PPL$RANGE_HIGH

new maximum range value

PPL$RANGE_INC

new increment


Appendix B Sec7.11.6

%XAXIS/qualifier,xlow,xhigh,xtic,y[,nmstc][,lint][,xunit][,ipos][,csize][,frmt]

This command draws an x-axis and redefines scaling for the x-direction. The arguments xlow, xhigh, xtic and y should not be omitted. See the %RANGE command to get default values for axis limits and increments. If you have used %RANGE, then you can use

PPL$RANGE_LOW, PPL$RANGE_HIGH, PPL$RANGE_INC for xlow, xhigh and xtic.

xlow

min value of x user

xhigh

max value of x user

xtic

large tic increment user

yy

position user or inches

nmstc

number of small tics

lint

label interval (large tics)

xunit

divisor for axis label

ipos

-1 bottom, 0 none, +1 top of label

csize

character size inches

frmt

axis format char*20

Valid qualifiers are:

/[NO]USER determines units of y position. Default is /USER. If /NOUSER units are inches from the ORIGIN. (see the ORIGIN command)


Appendix B Sec7.11.7

%YAXIS/qualifier,ylow,yhigh,ytic,x[,nmstc][,lint] [,yunit][,ipos][,csize][,frmt]

This command draws an y-axis and redefines scaling for the y direction. The arguments ylow, yhigh, ytic and x should not be omitted. See the %RANGE command to get default values for axis limits and increments. If you have used %RANGE, then you can use PPL$RANGE_LOW, PPL$RANGE_HIGH, PPL$RANGE_INC for ylow, yhigh and ytic.

ylow

min value of y user

yhigh

max value of y user

ytic

large tic increment user

xx

position user or inches

nmstc

number of small tics

lint

label interval (large tics)

yunit

divisor for axis label

ipos

-1 left, 0 none, +1 right of label

csize

character size inches

frmt

axis format char*20

Valid qualifiers are:

/[NO]USER determines units of y position. Default is /USER. If /NOUSER units are inches from the ORIGIN. (see the ORIGIN command)

Example:

Here is a PPLUS command file which uses all the % routines described above. It can be found in the directory ppl$examples (PPL$EXAMPLES:CTD4.PPC), and can be executed in PPLUS to generate a plot.

c 
c PPLUS command file to plot EPIC CTD data demonstrating multiple axis
c capability.
c
c It plots Pressure vs Temperature, Salinity, Sigma_t, Oxygen.
c
box,off
window,on
size,8,10.5
origin,,2.3
format/ctd,epic
axlint,1,1
c pltnme,ctd4.plt
c
c First plot P vs T with T axis at top. Supress bottom x axis.
c
evar,t,p
rd,ppl$examples:ctd4
%opnplt
%range/nouser 'ppl$ymin(1)','ppl$ymax(1)',5
yfor,(i7)
yaxis,'ppl$range_high','ppl$range_low','ppl$range_inc'
title

axlabp,1
axset,,0
plot
c
c Plot P vs Salinity with S axis at top above T axis.
c
evar/next sal,p
rd
set ypos 'ppl$ylen' + .7
%range/nouser 'ppl$xmin(1)','ppl$xmax(1)',4
%xaxis/nouser,'ppl$range_low','ppl$range_high','ppl$range_inc',-
'ypos',,,,+1
%pltlin,1
c
c Plot P vs Sigma_t with S_t axis at bottom
c
evar/next sig,p
rd
set ypos 0.
%range/nouser 'ppl$xmin(2)','ppl$xmax(2)',4
%xaxis/nouser,'ppl$range_low','ppl$range_high','ppl$range_inc',-
'ypos',,,,-1
%pltlin 2
c
c Plot P vs Oxygen with O axis at bottom below S_t axis.
c
evar/next ox,p
rd
set ypos 'YPOS' - .7
%range/nouser 'ppl$xmin(3)','ppl$xmax(3)',4
%xaxis/nouser,'ppl$range_low','ppl$range_high','ppl$range_inc',-
'ypos',,,,-1
%pltlin 3
c
c Now use PPLUS EPIC symbols in moveable labels for graph titles
c
set ypost 'ppl$ylen' + 1.9
%label/nouser 0,'ypost',-1,0.,.16,'ppl$epic_latitude1'
'ppl$epic_longitude1'
set ypos 'ypost' + .3
%label/nouser 0,'ypos',-1,0.,.16,'ppl$epic_cast1'
'ppl$epic_date1'
%clsplt



Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: