You are on page 1of 110

D I S G C L 10.

3
A Graphics Command Language by Helmut Michels

c

Helmut Michels, Max Planck Institute for Solar System Research, Katlenburg-Lindau 1995 - 2013 All rights reserved.

Contents
1 Overview 1.1 Introduction . . . . . . . . . . . . 1.2 Syntax of the DISGCL Command 1.3 Syntax of DISGCL Script Files . . 1.4 Syntax of Statements . . . . . . . 1.5 Data Types . . . . . . . . . . . . 1.6 Expressions . . . . . . . . . . . . 1.7 Quickplots . . . . . . . . . . . . . 1.8 FTP Sites, WWW Homepage . . . 1.9 Reporting Bugs . . . . . . . . . . Data Types, Variables 2.1 Data Types . . . . . . . . . 2.2 Variables . . . . . . . . . . 2.3 System Variables . . . . . . 2.4 Specifying Constants . . . . 2.5 Arrays . . . . . . . . . . . . 2.6 Subscripts . . . . . . . . . . 2.7 Character Arrays and Strings Expressions and Operators 3.1 Operators . . . . . . . . . 3.2 Array Operations . . . . . 3.3 Type Conversions . . . . . 3.4 Type Conversion Functions 1 1 1 2 2 4 4 4 5 5 7 7 7 8 8 8 9 9 11 11 12 12 14 15 15 15 15 15 16 16 16 17 17 17 18 18 19 19 20

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

2

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

3

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

4

Statements 4.1 Identification of Script Files . . . . . . . . . . 4.2 Comment Lines . . . . . . . . . . . . . . . . . 4.3 Calling DISLIN Routines . . . . . . . . . . . . 4.3.1 Calling DISLIN Subroutines . . . . . . 4.3.2 Calling DISLIN Functions . . . . . . . 4.3.3 Passing Parameters to DISLIN Routines 4.4 DISGCL Commands . . . . . . . . . . . . . . 4.5 Initializing Arrays with { } . . . . . . . . . . . 4.6 The IF Statement . . . . . . . . . . . . . . . . 4.7 IF Constructs . . . . . . . . . . . . . . . . . . 4.8 SWITCH Statements . . . . . . . . . . . . . . 4.9 The DO Statement . . . . . . . . . . . . . . . 4.10 The WHILE Statement . . . . . . . . . . . . . 4.11 The BREAK Statement . . . . . . . . . . . . . 4.12 The CONTINUE Statement . . . . . . . . . . . i

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

4.13 The GOTO Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.14 Executing System Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 DISGCL Commands 5.1 Termination of DISGCL 5.2 Getting Help . . . . . . . 5.3 Including DISGCL Files 5.4 Listing Variables . . . . 5.5 Freeing Variables . . . . 5.6 The PRINT Command . 5.7 Logging Commands . . . 5.8 Creating Arrays . . . . .

20 20 21 21 21 21 21 22 22 22 22 23 23 23 24 24 24 24 25 27 27 27 28 28 28 28 28 29 29 29 30 33 33 33 35 37 37 39 40 40 41 43 43 43 44 45

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

6

User-defined Subroutines and Functions 6.1 Calling User-defined Subroutines . . 6.2 Calling User-defined Functions . . . 6.3 The SUBROUTINE Statement . . . 6.4 The FUNCTION Statement . . . . . 6.5 The EXTERN Statement . . . . . . 6.6 The RETURN Statement . . . . . . 6.7 Parameters . . . . . . . . . . . . . . Quickplots 7.1 The PLOT Command . . . . 7.2 The SCATTR Command . . 7.3 The PLOT3 Command . . . 7.4 The PLOT3R Command . . 7.5 The SURF3 Command . . . 7.6 The SURFACE Command . 7.7 The SURSHADE Command 7.8 The CONTOUR Command . 7.9 The CONSHADE Command 7.10 Scaling of Quickplots . . . . 7.11 Quickplot Variables . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

7

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

8

Data Files 8.1 Syntax of Data Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.2 Data File Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.3 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Input and Output 9.1 Formatted Output with PRINTF . 9.2 Formatted Output with SPRINTF . 9.3 Formatted Input with SCANF . . 9.4 Formatted Input with SSCANF . . 9.5 File Access . . . . . . . . . . . . 9.6 Formatted Output to Files . . . . . 9.7 Formatted Input from Files . . . . 9.8 Text Input and Output Functions . 9.9 Binary Input and Output Functions 9.10 Example . . . . . . . . . . . . . .

9

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . . ii

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

A Intrinsic Functions A.1 Mathematical Functions . . . . . . A.2 Type Conversion Functions . . . . A.3 Complex Functions . . . . . . . . A.4 Array Functions . . . . . . . . . . A.5 Variable and Parameter Functions A.6 Data File Functions . . . . . . . . A.7 Memory Allocating Functions . . A.8 String Functions . . . . . . . . . . A.9 File Functions . . . . . . . . . . . A.10 Input and Output Functions . . . . A.11 System Functions . . . . . . . . . A.12 Time Functions . . . . . . . . . . A.13 Random Number Functions . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

47 47 48 48 49 49 50 50 51 51 52 53 53 53 55 55 56 56 57 58 58 59 60 60 61 61 62 63 64 64 64 64 66 67 67 68 68 69 69 69 70 71 74 74 75 76 76 79 79

B Short Description of DISLIN Routines B.1 Initialization and Introductory Routines B.2 Termination and Parameter Resetting . . B.3 Plotting Text and Numbers . . . . . . . B.4 Colours . . . . . . . . . . . . . . . . . B.5 Fonts . . . . . . . . . . . . . . . . . . B.6 Symbols . . . . . . . . . . . . . . . . . B.7 Axis Systems . . . . . . . . . . . . . . B.8 Secondary Axes . . . . . . . . . . . . . B.9 Modification of Axes . . . . . . . . . . B.10 Axis System Titles . . . . . . . . . . . B.11 Plotting Data Points . . . . . . . . . . . B.12 Legends . . . . . . . . . . . . . . . . . B.13 Line Styles and Shading Patterns . . . . B.14 Cycles . . . . . . . . . . . . . . . . . . B.15 Base Transformations . . . . . . . . . . B.16 Shielding . . . . . . . . . . . . . . . . B.17 Parameter Requesting Routines . . . . . B.18 Elementary Plot Routines . . . . . . . . B.19 Conversion of Coordinates . . . . . . . B.20 Utility Routines . . . . . . . . . . . . . B.21 Date Routines . . . . . . . . . . . . . . B.22 Cursor Routines . . . . . . . . . . . . . B.23 Transparency . . . . . . . . . . . . . . B.24 Bar Graphs . . . . . . . . . . . . . . . B.25 Pie Charts . . . . . . . . . . . . . . . . B.26 Coloured 3-D Graphics . . . . . . . . . B.27 3-D Graphics . . . . . . . . . . . . . . B.28 Geographical Projections . . . . . . . . B.29 Contouring . . . . . . . . . . . . . . . B.30 Image Routines . . . . . . . . . . . . . B.31 Window Routines . . . . . . . . . . . . B.32 Widget Routines . . . . . . . . . . . . B.33 DISLIN Quickplots . . . . . . . . . . . B.34 MPS Logo . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

C Examples C.1 Demonstration of CURVE . C.2 Polar Plots . . . . . . . . . . C.3 3-D Colour Plot . . . . . . . C.4 Surface Plot . . . . . . . . . C.5 Contour Plot . . . . . . . . . C.6 Shaded Contour Plot . . . . C.7 World Coastlines and Lakes C.8 Widgets . . . . . . . . . . . Index

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

81 82 84 86 88 90 92 94 96 99

iv

operators.1 Introduction This manual describes the graphics command language DISGCL which is an interpreter based on the graphics software DISLIN. user-defined subroutines and functions. The extension ’. high-level language elements can be used within DISGCL.Chapter 1 Overview 1. if and switch statements. This option can be used to initialize variables with different values. The format of data files is very simple and useful for most DISLIN plotting routines. means that the extension ’. %ARG2. array operations. or can be entered in an interactive mode.. The arguments are stored in the system variables %ARG1. 1.gcl]] [args] [options] is the name of a DISGCL script file. An easy to use interface for data input is given to include data into DISGCL jobs. The number of passed arguments is stored in the system variable %NARGS.. are optional arguments that can be passed to DISGCL scripts. These are variables. defines the file used for data input.. 1 options -D=device -F=file -I=file -f -o . This parameter will overwrite the keyword in the DISLIN routine METAFL and can have the same values as the parameter in METAFL. loops. This parameter will overwrite the file parameter in the routine DATFIL. . replaces the file parameter of the first INCLUDE statement in an DISGCL script file. 1 <= i <= n. opens a console window on Windows systems. %ARGn. Similar to programming languages such as Fortran and C.gcl’ is optional. Several quickplots are offered by DISGCL which are collections of DISLIN statements to display data with one command. is an optional field of keywords separated by blanks: defines the format of the metafile created by DISLIN. or can be requested with the function GETARG (i).gcl’ is not added to the filename. and file I/O routines.2 Syntax of the DISGCL Command The DISGCL command has the following syntax: Command: filename args disgcl [filename[. expressions. All DISLIN statements can be written to a script file and then be executed with DISGCL.

10 SUM = SUM + I END DO PRINT SUM 1.String constants must be enclosed in a pair of either apostrophes or quotation marks.4 Syntax of Statements The following statements can be used in DISGCL script files.DISGCL searches the current working directory for the DISGCL script file.Lines are allowed to carry trailing comment fields.If no parameters are specified.Keywords and routine names can be in upper and lowercase letters.Each line may contain up to 132 characters. or can be typed directly at the DISGCL prompt.A DISGCL script file must begin with the indentifier ’%GCL’. . Empty lines are also be interpreted as comment lines. 2 . . .The current statement can be continued on the next line if a masterspace (@) is used at the end of the line. DISGCL searches the directory defined by the environment variable GCL PATH. Example: %GCL SUM = 0 DO I = 1.On UNIX systems. .-v prints program version and author. .3 Syntax of DISGCL Script Files DISGCL script files must have the following syntax: . an DISGCL script file can be executed directly if the following line is included at the beginning of the script file: #! /path/disgcl -f where path is the directory containing the disgcl executable. following a double slash (//) or the ’#’ character. 1. . . DISGCL runs in interactive mode. If the search fails. Notes: .

.. Up to 8 loops can be nested. WHILE loop... Up to 8 IF constructs can be nested. GOTO statement. n2. Label statement. Figure 1. Call of a DISLIN or DISGCL routine. Up to 8 SWITCH statements can be nested.. SWITCH statement where iexpr must be an integer expression and n1. Creates and initializes an integer or floating point array. Executes a system command. DISGCL command. DISGCL or user-defined function. DO loop. DEFAULT: statements END SWITCH label: GOTO label $command Description Identifier for DISGCL script files. The ELSE IF and the ELSE parts are optional. Call of a user-defined subroutine. Assigns the value of the expression to the variable v.1: DISGCL Statements 3 .expr3] statements END DO WHILE (expr) statements END WHILE SWITCH (iexpr) CASE n1: statements CASE n2: statements . IF statement (conditional statement)..Command %GCL // Comment or # Comment routine (parameter list) CALL routine (parameter list) v = function (parameter list) v = expression command [parameter list] vray = { constant list } IF (expression) statement IF (expression) statements ELSE IF (expression) statements ELSE statements END IF DO v = expr1. integer constants. IF construct... Call of a DISLIN. Up to 8 loops can be nested. expr2 [. Comment line and inline comments.

an 16-bit integer in the range -32768 to 32767. an 32-bit floating point number in the range 1.2E-308 to 1.2E-38 to 3.14159)) 1. sin (x/5) 4 .2E-38 to 3.6 Expressions An expression is an combination of operands and operators. an 32-bit integer in the range -2147483648 to 2147483647. variables and functions. The following data types are known by DISGCL: CHAR BYTE SHORT INT FLOAT DOUBLE COMPLEX STRING an 8-bit integer in the range -128 to 127.5 Data Types Variables in DISGCL are dynamic. and they can change their types during the lifetime of a DISGCL session. They don’t have to be declared. an 64-bit floating point number in the range 2. the DISGCL command PLOT displays two-dimensional curves. Strings are stored as CHAR arrays terminated with the ASCII value zero.1. Example: x = falloc (100) plot x. Example: a = 60 x = exp (sin (a * 3.4E+38. Expressions can be assigned to variables or can be passed as parameters to subroutines and functions.8E+308 and with 15-digit precision. For example. an 8-bit integer in the range 0 to 255.4E+38 and with 7-digit precision. and may be scalars or arrays.7 Quickplots DISGCL offers several quickplots which are collections of DISLIN routines that can display data with one command. a sequence of characters. The operands can be constants. 1. a pair of 32-bit floating point numbers in the range 1.

de Tel.Figure 2.8 FTP Sites.dislin.de/pub/grafik/dislin The DISLIN Homepage is: http://www.: +49 5556 979 334 Fax: +49 5556 979 240 5 . Max-Planck-Str.gwdg. ’Data Files’.mpg.9 Reporting Bugs DISGCL bugs can be reported to the author: Helmut Michels Max-Planck-Institut fuer Sonnensystemforschung D-37191 Katlenburg-Lindau. The widget interfaces for quickplots expect data in the form of data files described in chapter 8.1: Example of the PLOT Command Note: All quickplots have corresponding widget interfaces that can be executed with the command disgcl quickplot where quickplot is the name of a quickplot. Germany E-Mail: michels@linmpi. 1. 2.de 1. WWW Homepage DISGCL and DISLIN are available via ftp anonymous from the following sites: ftp://ftp.

6 .

255 -32768 . But in DISGCL. or underscores. and they don’t have to be declared.1 Data Types As described in the last chapter.2E-308 .4E+38 2. As in other programming languages. DISGCL data can have the following types: Type CHAR BYTE SHORT INT FLOAT DOUBLE COMPLEX STRING Number of Bytes 1 1 2 4 4 8 8 n+1 Figure 2. keywords. digits.2147483647 1.Chapter 2 Data Types. variables can also change their types. 2.3. . . Variables This chapter explains the DISGCL data types and shows how to specify constants and variables. Other characters can be letters.DISGCL is not case-sensitive.2E-38 . variables can change their values during the lifetime of a DISGCL session. routines and parameters can be specified in uppercase and lowercase letters. 7 .2E-38 .The first character must be a letter.32767 -2147483648 .8E+308 1.127 0 . functions.4E+38 2. Variable names.The first 16 characters of variable names are significant. The following rules are applied to variables: .1.2 Variables All data in DISGCL are variables or constants.1: Data Types Range -128 .3.

5] = 3.4) COMPLEX (7) Type Decimal Hexadecimal Floating point Floating point String String COMPLEX COMPLEX Figure 2. 10.6E2 ”ABC” ’abc’ COMPLEX (3. Examples: A[i] = 5 B[i. INT. floating point numbers and strings.The DISGCL commands CHAR.2: Constants 2. For example. j] = 8 C[0. Constants can be integers. Examples: Constant 120 0xFF 0. Complex constants contain the keyword ’COMPLEX’ and a real and imaginary part.4 Specifying Constants Constants are data that cannot change their values during the life of a DISGCL session.If an expression is assigned to a variable and the value of the expression is an array.3 System Variables System variables are special variables with a predefined meaning.5 There are several ways to create arrays in DISGCL: . DOUBLE and COMPLEX create corresponding arrays and initialize them with zeros. 2. String constants must be enclosed in a pair of either apostrophes or quotation marks. Multidimensional arrays can be defined and accessed by specifying subscripts separated by commas. Example: 8 . The imaginary part is optional and assumed to be zero if it is omitted. System variables begin with the ’%’ character and are available to all DISGCL units such as subroutines and functions. BYTE. Integer constants can be specified in decimal or hexadecimal notation. FLOAT.2. SHORT. Array elements can be accessed by specifying subscripts in square brackets.5 Arrays An array is a collection of data that share the same type and a common name. system variables can be used to set options for quickplots. the variable will also be an array. Floating point constants contain a decimal point and can have an exponential part preceded by e or E.56 3. .

DISGCL prints a warning and cancels the calculation. j] Element i of array A Array section of size j .1 of column j The whole column j.i + 1 Elements i1 to i2 of column j Elements 0 to i2 of column j Elements i1 to m . . 2. The following are examples of array subscripts: A[i] A[i:j] B[i1:i2.7 Character Arrays and Strings Strings in DISGCL are stored as character arrays terminated with ASCII value zero. the corresponding element is handled as an integer where the value of the integer is the ASCII code of the element. 2. B[20.INT A[10]. Character arrays can be defined with the CHAR command. Notes: .Array elements begin with the number 0. j] B[i1:. strings and character arrays can be used in the same way if character arrays contain a string terminator. 9 .6 Subscripts Subscripts can be used to access single array elements or sections of arrays. . j] B[:i2. Normally.If a subscript of an array is out of range.Multidimensional arrays are stored by rows.10] . Some I/O functions require character arrays instead of strings to store characters.Integer and floating point arrays can be created and initialized with the statement: vray = { list } where list is a constant list of integers or floating point numbers separated by commas. .If a subscript appears in a string or a CHAR array. j] B[*.

10 .

1 shows all DISGCL operators and summarizes the rules for precedence and associativity of operators. 3.1 Operators Figure 3. the operator with the higher precedence is evaluated first.1: Operators The first column in figure 3. This means that when two operators have different precedence. Priority 1 2 Operator ** + ! 3 * / % 4 + 5 < <= > >= == != 6 && || Meaning Exponentiation Unary minus Unary plus Logical NOT Multiplication Division Modulus Addition Subtraction Less than Less than or equal Greater than Greater than or equal Equal Not equal Logical AND Logical OR Figure 3. variables and functions. and may be scalars or arrays. The operators are displayed in the following paragraph. The highest precedence is 1. The operands can be constants. 11 Associativity Right to left Right to left Right to left Right to left Left to right Left to right Left to right Left to right Left to right Left to right Left to right Left to right Left to right Left to right Left to tight Left to right Left to right .1 gives the precedence of an operator.Chapter 3 Expressions and Operators An expression is an combination of operands and operators.

3 shows the rules for type conversions if both operands are scalars or both are arrays: 12 .When two operators have the same precedence.3 Type Conversions When an operator has operands of different types. has the value 3 since ’*’ and ’/’ are evaluated from left to right. the operands in an expression can be scalars and arrays.array array / array array * array array ** array array + scalar scalar + array array . they are converted to a common type. 3.scalar scalar -array array * scalar scalar * array array / scalar scalar / array array ** scalar scalar ** array Value array array array array array array array array array array array array array array array Figure 3. Figure 3. The order of normal precedence can be changed by enclosing expressions in parenthesis. has the value 256 since ’**’ is evaluated from right to left.2 shows the allowed array operations: Operation array + array array . Examples: 3*2+1 2*3/2 2 ** 2 ** 3 has the value 7 since the operator ’*’ has a higher precedence than the operator ’+’. they are evaluated in the direction specified in the last column ’Associativity’.2: Array Operations 3. Figure 3.2 Array Operations In DISGCL.

4: Type Conversions between Scalars and Arrays Note: A ’*’ means that this operation is not allowed.3: Type Conversions Notes: . 13 . A warning will be displayed by DISGCL if this operation appears in an expression.Complex operands can be used with other operands. the value of the expression is also an array. When one operand is a scalar and the other operand an array. . The following figure shows the rules for type conversions between scalars and arrays: Scalar/Array BYTE SHORT INT FLOAT DOUBLE BYTE BYTE BYTE BYTE * * SHORT SHORT SHORT SHORT * * INT INT INT INT FLOAT FLOAT FLOAT FLOAT FLOAT FLOAT FLOAT FLOAT DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE Figure 3.BYTE BYTE SHORT INT FLOAT DOUBLE BYTE SHORT INT FLOAT DOUBLE SHORT SHORT SHORT INT FLOAT DOUBLE INT INT INT INT FLOAT DOUBLE FLOAT FLOAT FLOAT FLOAT FLOAT DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE DOUBLE Figure 3. The result is complex.The only allowed operation between strings is the concatination with the ’+’ operator.

4 Type Conversion Functions DISGCL provides a set of functions that convert types of variables and expressions. DOUBLE (x) COMPLEX (x.6: Type Conversion Examples Meaning 14 . x is converted to the real.3. type conversion functions check operands for overflow and print warnings. Z = COMPLEX (3) creates the complex number Z with the real part 3 and the imaginary part 0. The second parameter y is optional. converts to COMPLEX. y to the imaginary part. converts x to INT. 4) converts A to a floating point array. Figure 3. The conversion functions are as follows: Function BYTE (x) CHAR (x) SHORT (x) INT (x) FLOAT (x) Meaning converts x to BYTE. converts x to FLOAT. y) converts x to DOUBLE. FLOAT returns the real part of x. IR = {65. converts x to CHAR. Examples: Example INT A[100] A = FLOAT (A) Z = COMPLEX (3. 67. If x is complex. 68} S = STRING (IR) creates the string S = ’ABCD’. 66.5: Type Conversion Functions Note: Normally. converts x to SHORT. Figure 3. STRING (x) converts x to STRING. creates the complex number Z with the real part 3 and the imaginary part 4.

1 Identification of Script Files DISGCL script files must begin with the string ’%GCL’ where the string can appear in upper or lowercase letters.3. 4.Chapter 4 Statements This chapter describes the statements that can appear in DISGCL script files. 4. or can be entered at the DISGCL prompt. 15 .2 Comment Lines Empty lines and lines beginning with a double slash (//) or a ’#’ character are interpreted as commend lines. DISLIN routines can either be subroutines that return no value. Example: %GCL PRINT 3 + 4 4. following a double slash. Example: %GCL // This is a comment PRINT 3 + 4 // This is also a comment 4. Lines are also allowed to carry trailing comment fields. or functions that return a value.1 Calling DISLIN Subroutines DISLIN subroutines can be executed with the statement: routine (list) where routine is the name of a DISLIN routine and list the parameters of the routine separated by commas.3 Calling DISLIN Routines About 500 DISLIN routines for plotting and parameter setting can be executed from DISGCL.

0.. Integer constants must be specified without decimal points. Normally. denotes a byte array. DISGCL checks the number and types of parameters passed to DISLIN routines. a warning is printed on the screen and the call of the routine will be ignored.Example: %GCL METAFL DISINI GRAF DISFIN (’CONS’) () (0. Example: PRINT FALLOC(10) 16 . arrays must be passed to DISLIN routines as integer or floating point arrays.) () 4.. denotes a string. 4.. 4. denotes a floating point.2 Calling DISLIN Functions DISLIN functions can be executed with the statement: v = function (list) where function is the name of a DISLIN function and list the parameters of the function separated by commas. 2... variables and expressions.3. denotes a floating point array.. 5. 1. 0. Example: N = TRMLEN (1) DISGCL will print the warning: >>>> Paramter mismatch User : TRMLEN (I) Correct : TRMLEN (S) The abbreviations in parameter mismatch warnings have the meaning: I X D S BR IR FR DR denotes an integer parameter. denotes a double parameter.3. 0. If an error occurs. denotes an integer array. denotes a double array.. 10.3 Passing Parameters to DISLIN Routines Actual parameters in DISLIN routines can be constants. Several DISGCL commands are explained in the next chapter. floating point constants can be passed without decimal points. integer or double parameter.4 DISGCL Commands A DISGCL command can be executed with the statement command [list] where command is the name of a DISGCL command and list the parameters of the command separated by commas.

4.7 IF Constructs IF constructs are statements for decision making.Up to 8 IF constructs can be nested.5 Initializing Arrays with { } Integer and floating point arrays can be created and initialized with the statement vray = { list } where list is a constant list of integers or floating point numbers separated by commas. the statements in the IF block will be executed. The syntax is: IF (expr) statement Example: IF (I < 10) A = 1 4. FLOAT. ELSE or END IF statement. Example: IF (A > 0) ISIGN = 1 ELSE IF (A < 0) ISIGN = -1 ELSE ISIGN = 0 END IF Notes: . Note: Arrays can also be created and initialized with the functions FALLOC. SHORT.4. CHAR. DOUBLE and COMPLEX.The ELSE IF and ELSE blocks are optional. 17 . . INT. if expression is false.6 The IF Statement The IF statement executes a statement if a logical expression is true. and with the DISGCL commands BYTE. control is transferred to the next ELSE IF. DALLOC and IALLOC.Multiple ELSE IF blocks can be specified. The syntax is: IF (expression) statements ELSE IF (expression) statements ELSE statements END IF If expression is true. .

.9 The DO Statement The DO statement can be used to repeat statements a set number of times.8 SWITCH Statements The SWITCH statement is a multi-way decision that tests whether an expression matches one of the number of constant integer values. . The syntax is: DO v = expr1.4. The syntax is: SWITCH (iexpr) CASE n1: statements CASE n2: statements .. expr2 [.expr3] statements END DO where v expr1 expr2 is a loop counter. %GCL S = ’This is a test’ I=0 NCHAR = 0 NBLANK = 0 WHILE (S[I] != 0) SWITCH (S[I]) CASE 32: NBLANK = NBLANK + 1 DEFAULT: NCHAR = NCHAR + 1 END SWITCH I=I+1 END WHILE PRINT NCHAR. The DEFAULT case is optional. If a case matches iexpr..Up to 8 SWITCH statements can be nested. NBLANK Notes: .... The case labeled DEFAULT is executed if none of the other cases are satisfied. execution starts at that case. is an expression that initializes v. DEFAULT: statements END SWITCH Each case must be labeled by an INT constant while iexpr can be an integer expression... The following example counts the number of characters and the number of blanks in a string ..The BREAK statement causes an immediate exit from a SWITCH statement. 18 . 4. is an expression that defines the end of the loop range.

. Notes: .Up to 8 WHILE loops can be nested. Example: I=0 WHILE (I < 10) I=I+1 PRINT I IF ( I == 3) BREAK END WHILE The output of the example is: 1 2 3 Note: 19 . 4.The loop counter of a DO loop can be modified by statements within the loop. 4. . The value cannot equal zero. array data should be processed by array operations instead of operations in a loop.Jumping into a DO loop from outside its range is not allowed. The syntax is: WHILE (expr) statements END WHILE Example: I=0 SUM = 0 WHILE (I < 10) I=I+1 SUM = SUM + I END WHILE The following restrictions apply to WHILE loops: .Jumping into a WHILE loop from outside its range is not allowed.10 The WHILE Statement A WHILE loop repeats as long as a given condition remains true.11 The BREAK Statement The BREAK statement causes an immediate exit from a SWITCH.expr3 is an optional expression that will be used as an increment for the loop counter.Up to 8 DO loops can be nested. The following restrictions apply to DO loops: . The default value is 1.Overlapping of WHILE and IF constructs are not allowed.Whenever possible. . Array operations are much more faster than loop operations. . . DO and WHILE construct.Overlapping of DO and IF constructs are not allowed.

For label names. 20 .13 The GOTO Statement The GOTO statement makes a jump to another part of the DISGCL file. 5 IF ( I == 3) CONTINUE PRINT I END DO The output of the example is: 1 2 4 5 4. Example: DO I = 1. The target of the GOTO statement must be a label statement which has the syntax: Label: Example: I=0 L1: I=I+1 PRINT I IF (I < 5) GOTO L1 The output of the example is: 1 2 3 4 4.The BREAK statement ends only the loop in which it appears. Example: $DIR displays the files in the current directory if the operating system is MS-DOS or VMS (use $ls for UNIX).14 Executing System Commands System commands can be executed with the statement $Command where Command is a system command. 4. The syntax is: GOTO Label where Label is the name of a label. the same rules as for variable names are applied.12 The CONTINUE Statement The CONTINUE statement can be used to skip all following statements in a loop and to execute the loop with the next iteration.

. only user-defined variables are listed.4 Listing Variables The command LIST list all defined variables. If the search fails. If -s is used. vn] can have the values -s and -u. v2. DISGCL searches the directory defined by the environment variable GCL PATH.Chapter 5 DISGCL Commands This chapter describes several DISGCL commands. . vn LIST [option] [v1. . If no variables are specified.3 Including DISGCL Files A DISGCL file can be included into another DISGCL file or DISGCL session with the statement INCLUDE ’file[.. . only system variables are listed. if -u is used. The call is: option v1. The call is: HELP 5. 5.DISGCL searches the current working directory for the filename. v2.. 21 . The call is: EXIT 5.Up to 8 include files can be nested.2 Getting Help The HELP command activates a menu for getting help.gcl]’ Notes: .. are the names of variables. all defined variables are listed.1 Termination of DISGCL The command EXIT terminates a DISGCL session. 5.

10] creates an array A with 10 elements and a matrix B with 5 rows and 10 columns. INT. 5.5.If the file cfil already exists. v2.5 Freeing Variables The command FREE deallocates the space allocated by arrays and strings. CHAR. The call is: cfil Notes: ... expr2.. 5. SHORT. . ..A log file can be executed with the DISGCL command.. vn are the names of variables. . 22 . FLOAT A[10]. FLOAT.. expr2. 5. The call is: PRINT expr1. exprn expr1. v2.7 Logging Commands The command LOGON defines a file where interactive commands will be logged. a new file version will be created. . vn FREE v1. B[5. LOGON cfil is a string containing a filename.8 Creating Arrays The commands BYTE.. .. .6 The PRINT Command The command PRINT prints the value of an expression on the screen. The call is: list Example: FLOAT list is a list of arrays with dimension specifications separated by commas.Logging can be terminated with the command LOGOFF. exprn are expressions.. DOUBLE and COMPLEX create corresponding arrays and initialize them with zeros. The call is: v1. or can be included into a DISGCL session with the INCLUDE statement..

2 Calling User-defined Functions A user-defined function is called in the same way as a DISLIN and DISGCL function.They make debugging easier. 6. Once the subroutine or function is tested. are the parameters of the function separated by commas.They use local variables and labels that are not visible to other parts of the DISGCL task. If the search fails. The first statement in the file must be the identifier ’%GCL’. 23 . The syntax is: v = function (list) where function list is the name of the function.Chapter 6 User-defined Subroutines and Functions User-defined subroutines and functions can be used to break large DISGCL tasks into several parts. DISGCL adds the extension ’. The syntax is: CALL routine (list) where routine list is the name of the subroutine. Each user-defined subroutine or function must be stored in a file with the extension ’. . DISGCL searches the directory defined by the environment variable GCL PATH. . are the actual parameters of the subroutine separated by commas. 6. Subroutines and functions offer some advantages: .gcl’ where the name of the file and the name of the routine must be identical.gcl’ to the name of the subroutine and searches the current directory for the filename.They eleminate repetition of code. Functions and subroutines are terminated with the first END statement that should be the last statement in the file. it can be used in many other DISGCL runs. The next non-comment statement in the file should be either the SUBROUTINE or the FUNCTION statement.1 Calling User-defined Subroutines The CALL statement executes a user-defined subroutine.

If the search also fails.. DISGCL searches the directory defined by the environment variable GCL PATH. for functions. v2. vn are the names of variables. User-defined functions.. These are variables that are defined outside of functions and subroutines. 6. DISGCL functions. 6. 24 .6 The RETURN Statement The RETURN statement can be used to exit a subroutine and must be used in a function to return a value. .The search order for functions is: 1. DISGCL adds the extension ’. v2..5 The EXTERN Statement The EXTERN statement can be used to access variables of the main DISGCL unit. are the formal parameters of the subroutine separated by commas. The syntax is: EXTERN v1. vn where v1.. 6. . are the formal parameters of the function separated by commas.. It has the syntax: SUBROUTINE routine (list) where routine list is the name of the subroutine.3 The SUBROUTINE Statement The SUBROUTINE statement must be the first non-comment statement in a user-defined subroutine (after the identifier ’%GCL’). The syntax is: RETURN RETURN expr for subroutines. If the search for a DISLIN and DISGCL function fails. 2.4 The FUNCTION Statement The FUNCTION statement must be the first non-comment statement in a user-defined function (after the identifier ’%GCL’).. It has the syntax: FUNCTION function (list) where function list is the name of the function.gcl’ to the name of the function and searches the current directory for the filename. DISLIN functions. 6. 3.

. FLOAT. The name of the parameter can have a dimension specification that means that the actual parameter must be an array. n) can be used to analyse passed parameters (see Appendix A). is an optional keyword for the parameter that identifies which parameter is being passed. If a type declaration is specified. The function KEYCNT () returns the number of keyword parameters passed to a subroutine or function.The number of actual parameters can be lower than the number of formal parameters. DISGCL compares automatically the type of actual and formal parameters. DOUBLE. It can have the keywords BYTE. Formal parameters are the parameters declared in the SUBROUTINE or FUNCTION statement. Parameters in the CALL statement of a subroutine or in the function reference are called actual paramters. COMPLEX and STRING. A formal parameter has the syntax: [type:][key=]name where type is an optional type declaration of the parameter. The functions VARDEF (x). is the formal name of the parameter. The function ARGCNT() returns the total number of parameters passed to a subroutine or function. VARCNT (x) and VARDIM (x. VARTYP (x).6. SHORT. is an expression.If the number of actual parameters is greater than the number of formal parameters. is an optional keyword for the parameter. key name Example: SUBROUTINE MYSUB (FLOAT: A. FLOAT: DATA=X[]) An actual parameter has the syntax: [key=]expr where key expr Example: CALL MYSUB (3. 10.7 Parameters Variables and expressions can be passed as parameters to user-defined functions and subroutines. or a keyword is used that is not defined in the formal parameter list. . DISGCL displays a warning and ignores the routine call. INT: N. DATA=XRAY) Notes: . CHAR. 25 . INT.

26 .

1 The PLOT Command The command PLOT makes a quickplot of two or more floating point arrays.xray2.. yray1 SCATTR xray1. The following rules are applied to quickplots: .. x = falloc (100) plot x. xrayn. there are no calls to ENDGRF and DISFIN in quickplots. Note: All quickplots have corresponding widget interfaces that can be executed with the command gcl quickplot where quickplot is the name of a quickplot. . .2 The SCATTR Command The command SCATTR makes a quickplot of two or more floating point arrays where the points are marked with symbols. cos (x) 7. they let DISLIN in level 2 or 3. quickplots are terminated with DISFIN to get back to the text mode. . yray2.Quickplots call DISINI automatically if it is not called before.. yray1 [. 27 . . xrayn. The widget interfaces for quickplots expect data in the form of data files described in chapter 8. METAFL (’XWIN’) will be used in quickplots if METAFL is not used before.xray2.On X Window terminals. sin (x). . ’Data Files’. yrayn] are floating point arrays. .Chapter 7 Quickplots This chapter presents quickplots that are collections of DISLIN routines to display data with one command. 7.On other terminals such as VGA screens. yray2. yray1 Example: PLOT xray1. following quickplots will overwrite the graphics window without erasing the window. The call is: xray1. If the variable %ERASE is set to 0. yrayn] are floating point arrays. yray1 [. x. The call is: xray1..

..coordinates of rectangle corners.. 1. The call is: x1ray. . 7.6 The SURFACE Command SURFACE zmat [. an array with the values { 0... y1ray x2ray. 1. nx .} will be used.} will be used.4 The PLOT3R Command PLOT3R x1ray. m .5.0.1. It will be used to position the columns of zmat. 1.and Z-coordinates. The call is: zmat xray yray . is a floating point array with the dimension ny. yray. ny . The call is: xray. x2ray.xray. is a floating point array with the dimension m... ny .} will be used. yray] is a two-dimensional floating point array with nx rows and ny columns. an array with the values { 0.1.1.. It will be used to position the rows of zmat.5.. yray]] is a two-dimensional floating point array with m rows and n columns. yray.. zray are floating point arrays containing X-.. If yray is missing.5} will be used. It will be used to position the columns of zmat.. y2ray zray 7.. an array with the values { 0.1. The command PLOT3 makes a 3-D colour plot. is a floating point array containing Z-coordinates.. . Y. y2ray. is a floating point array with the dimension nx. is a floating point array with the dimension nx..5..0. The columns of the matrix will be plotted as rows.. The command SURFACE makes a surface plot of a matrix..7.xray [.} will be used... 1.and Y. . It will be used to position the rows of zmat. n .. The call is: zmat xray yray 7. 28 The command SURSHADE makes a shaded surface plot of a matrix. an array with the values { 0. . It will be used to position the rows of zmat. nx . is a floating point array with the dimension ny. zray are floating point arrays containing X. are floating point arrays containing the opposite rectangle corners. an array with the values { 0.. zray 7. If xray is missing. 1. The command PLOT3R makes a 3-D colour plot where the data are specified as rectangles. . If xray is missing.3 The PLOT3 Command PLOT3 xray... If xray is missing.7 The SURSHADE Command SURSHADE zmat [. 1.5.5 The SURF3 Command The command SURF3 makes a 3-D colour plot of a matrix. y1ray. The call is: zmat xray yray SURF3 zmat [..5} will be used. If yray is missing. an array with the values { 0. . It will be used to position the columns of zmat. If yray is missing..xray. is a floating point array with the dimension n. yray] is a two-dimensional floating point array with nx rows and ny columns.

. This behaviour can be changed if certain variables are defined. . .} will be used. nx . is a floating point array with the dimension ny.8 The CONTOUR Command The command CONTOUR makes a contour plot of a matrix. is a floating point array with the dimension nx. nx . %XMAX.1. If yray is missing. .. Y-axis. 29 Analog: Note: . If the system variables %XMIN.1. It will be used to position the rows of zmat.9 The CONSHADE Command The command CONSHADE makes a shaded contour plot of a matrix. If xray is missing. an array with the values { 0. .... For logarithmic scaling. Z-axis. If the system variable %XAUTO is defined and set to 1.} will be used. 1. 1. %XOR and %XSTEP are defined. It will be used to position the columns of zmat. 7.. 10 levels between the minimum and maximum of zmat will be generated.. is a floating point array containing the levels. If xray is missing. yray. zlvray] CONSHADE zmat. the parameters must be exponents of base 10. is a floating point array containing the levels. 1.. %XOR and %XSTEP will be ignored and scaling will be done automatically in the range of the data.1. It will be used to position the columns of zmat. If zlvray is missing. zlvray] CONTOUR zmat.7.. zlvray is a two-dimensional floating point array with nx rows and ny columns.. %XMAX... zlvray is a two-dimensional floating point array with nx rows and ny columns. is a floating point array with the dimension ny. the variables %XMIN.. 10 levels between the minimum and maximum of zmat will be generated. %XMAX.} will be used.. If yray is missing. yray.... If zlvray is missing. ny . 1. an array with the values { 0. The call is: or: zmat xray yray zlvray CONTOUR zmat [. quickplots are scaled automatically in the range of the data... an array with the values { 0.xray. 7.. is a floating point array with the dimension nx.xray. the scaling and labeling of the X-axis is completly defined by the user.} will be used. ny . It will be used to position the rows of zmat.10 Scaling of Quickplots Normally. an array with the values { 0.1. the X-axis will be scaled automatically in the range %XMIN. The call is: or: zmat xray yray zlvray CONSHADE zmat [. The variables for the X-axis are: a) b) c) If the system variables %XMIN and %XMAX are defined.

defines the scaling of the Y-axis (AXSSCL). defines line or symbol mode for CURVE (INCMRK). defines line 4 of the axis system title (TITLIN). defines the Y-Position of the axis system (AXSPOS). defines the scaling of the Z-axis (AXSSCL).7. sets the number of digits for the Y-axis (LABDIG). defines the size of axis titles (HNAME). defines the Z-axis title (NAME). defines an interpolation method used by CURVE (POLCRV). defines the X-Position of the axis system (AXSPOS). sets the number of ticks for the X-axis (TICKS). defines the Y-axis title (NAME). defines the size of the axis sytem title (HTITLE). sets the number of ticks for the Z-axis (TICKS). The corresponding DISLIN routines are given in parenthesis. 30 . defines line 1 of the axis system title (TITLIN). %X %Y %Z %T1 %T2 %T3 %T4 %XTIC %YTIC %ZTIC %XDIG %YDIG %ZDIG %XSCL %YSCL %ZSCL %XLAB %YLAB %ZLAB %H %HNAME %HTITLE %XPOS %YPOS %XLEN %YLEN %ZLEN %POLCRV %INCMRK %MARKER %HSYMBL %XRES defines the X-axis title (NAME). sets the number of ticks for the Y-axis (TICKS). sets the width of points plotted by PLOT3 (SETRES). defines the size of an axis system in X-direction (AXSLEN). defines the size of an axis system in Y-direction (AXSLEN). sets the number of digits for the Z-axis (LABDIG). defines line 3 of the axis system title (TITLIN).11 Quickplot Variables There is a set of variables that can modify the appearance of quickplots. defines the size of an axis system in Z-direction (AX3LEN). defines the scaling of the X-axis (AXSSCL). defines the labels of the Y-axis (LABELS). defines the size of symbols (HSYMBL). selctes a symbol for CURVE (MARKER). defines the labels of the Z-axis (LABELS). sets the number of digits for the X-axis (LABDIG). defines the labels of the X-axis (LABELS). defines line 2 of the axis system title (TITLIN). defines the character size (HEIGHT).

sets the Z-position of the viewpoint in absolut 3-D coordinates (VIEW3D). to initalize plotting parameters in DISINI.%YRES %X3VIEW %Y3VIEW %Z3VIEW %X3LEN %Y3LEN %Z3LEN %VTITLE %CONSHD Note: Example: sets the height of points plotted by PLOT3 (SETRES). selects an algorithm used for contour filling (SHDMOD). sets the X-position of the viewpoint in absolut 3-D coordinates (VIEW3D). xray 31 . defines vertical shifting for the axis system title (VKYTIT). defines the Y-axis length of the 3-D box (AXIS3D). defines the X-axis length of the 3-D box (AXIS3D). sets the Y-position of the viewpoint in absolut 3-D coordinates (VIEW3D). The variables can also be used. defines the Z-axis length of the 3-D box (AXIS3D). %X = ’X-axis’ %Y = ’Y-axis’ xray = falloc (10) plot xray.

32 .

A data file must begin with the keyword ’%GCL-ASC’.A data field begins with the keyword %DATA.1 Syntax of Data Files . where value is an integer.Lines are allowed to carry trailing comment fields. 8. The call is: CFIL ISTAT = DATFIL (CFIL) is the name of the data file. The format of data files is very simple and useful for most DISLIN plotting routines. If the search fails. 8. .2 Data File Routines DATFIL The following routines handle data files. or zero.Multiple data blocks can be given in one data file. . Empty lines are also be interpreted as comment lines. The following lines give the data separated by blanks or commas.gdf’ (Graphics Data File). Strings must be enclosed in a pair of either apostrophes or quotation marks. The default extension is ’.Each line may contain up to 512 characters.A data file can contain an optional header beginning with the keyword %HEADER. The routine DATFIL opens a file for data input. . The first non comment line after %DATA must contain the number of columns of the data field. a floating point number or a string. following a double slash (//).Chapter 8 Data Files This chapter describes data files that can be used to include data into DISGCL jobs. DATFIL returns -1 if it fails. Data can be specified as integer or floating point numbers where floating point numbers can contain an exponent part. DISGCL searches the directory defined by the environment variable GCL DATA. . . Variables can be defined in the header in the form name = value. DISGCL searches the current working directory for the data file. Note: 33 .

The call is: NCOLUMN XRAY XRAY = DATRAY (NCOLUMN) defines the column of the data file. The call is: ISTAT = DATCLS () DATHDR The routine DATHDR prints the header of a data file on the screen. is a returned floating point array. means the number of data in the current data block. and -1 if NBLOCK is not defined in the current data file. On error. The call is: COPT = ’ROWS’ = ’COLUMNS’ = ’FULL’ = ’BLOCKS’ N = DATCNT (COPT) is a string with the values means the number of rows in the current data block. DATMAT The routine DATMAT creates an array containing the whole current data block of the data file. The call is: XMAT XMAT = DATMAT () is a returned twodimensional floating point array.DATCLS The routine DATCLS closes the current data file. The call is: NBLOCK ISTAT = DATBLK (NBLOCK) specifies the current data block. is the returned value of the variable. The first occurrence of the variable is returned. means the number of columns in the current data block. The call is: CNAME V V = DATVAR (CNAME) is the name of the variable. DATCNT The routine DATCNT returns the number of data of the current data block in a data file. DATBLK returns 0 if the data block NBLOCK is defined. It returns -1 if it fails. The call is: ISTAT ISTAT = DATHDR () is the returned status of DATHDR and can have the values 0 and -1. DATHDR returns -1. DATBLK The routine DATBLK sets the current data block of a data file. 34 . DATRAY The routine DATRAY creates an array containing a column of the current data block in a data file. DATVAR The routine DATVAR returns the value of a variable defined in the header of a data file. or zero. means the number of blocks in the data file.

916108 218.580057 320.527225 72.902926 349.000000 -0.356886 305.605610 247.873849 43.363647 -0.909088 0.444067 130.934148 0.454559 -0.818184 0.181820 0.909088 -0.000000 14.981929 360.363640 0.818176 -0.8.766044 334.567060 -0.989821 -0.727272 0.849725 0.181824 -0.618159 -0.486197 0.727280 -0.189251 0.987439 203.429795 0.723734 58.3 Example %GCL-ASC %DATA 3 // Number of columns // x sin(x) cos(x) 0.795762 -0.090910 0.454544 0.993838 0.342020 -0.755750 -0.545456 0.786053 232.690079 0.204807 116.967949 29.954902 0.090912 -0.895994 -0.642788 0.000000 0.654861 145.000000 1.047582 101.823677 160.814576 0.095056 -0.296920 87.998867 0.978802 -0.000000 35 .939693 174.272720 -0.545441 -0.158001 -0.545455 0.995472 189.386345 261.090912 -0.000000 0.000000 -0.400931 -0.922354 -0.636364 0.142315 276.110838 290.251148 0.000000 1.636368 -0.272728 0.

36 .

The format string can contain ordinary characters and format specifications. PRINTF returns -1. or the number of digits after the decimal point of floating point values. is the returned status of PRINTF and can have the values 0 and -1..A minus sign.. The call is: CFMT ARG1. Conversion characters are shown in the following table: 37 .ARGn ISTAT ISTAT = PRINTF (CFMT..A number that specifies the minimum field length. Ordinary characters are printed as text while format specifications define how the arguments of PRINTF are formatted.. ARG2. A format specification begins with a % and ends with a conversion character. . are optional arguments. ARGn) is a format string. which separates the field width from the precision.A perid..Chapter 9 Input and Output This chapter describes functions that write formatted data to the screen and access disk files. 9. Between the % and the conversion character there may be the following parts: .A number that specifies the precision.. ARG1.1 Formatted Output with PRINTF The function PRINTF translates internal values and prints them on the screen. . . It defines the number of printed charcters from a string. which specifies left adjustment. . On error.

Figure 9.’ printf (’:%s: \n’.13s:\n’. prints an integer in octal format. printf (’:%17s: \n’. The output of the DISGCL script is: :This is a string.1: Conversion Characters Examples: The first example shows the effect of some format specifications for printing the string ’This is a string. : : This is a str: :This is a str : s) s) s) s) s) s) s) 38 . printf (’:%-20s: \n’. prints an integer.Character %c %d %i %s %f %e %x %o \n Meaning prints a character. %GCL s = ’This is a string.13s: \n’. printf (’:%17.: : This is a string.: :This is a string. prints a floating point number. prints a floating point number in e format. prints an integer (same as %d). printf (’:%15s: \n’. prints an integer in hexadecimal format.’ (17 characters). printf (’:%-17.: :This is a string.: :This is a string. inserts a newline. prints a string. printf (’:%20s: \n’.

456000: : 123.2 Formatted Output with SPRINTF The function SPRINTF does the same conversions as PRINTF does. printf (’:%-8.456000: :123. \n’. printf (’:%08d: \n’. x) x) x) x) x) x) x) 9.2d:\n’.456: %GCL x = 123. \n’. printf (’:%o: \n’. 39 .2E: The output is: :123. but stores the output in a character array.234560E+02 : :1. printf (’:%08X: \n’.2f: printf (’:%e: printf (’:%-15E: printf (’:%-15. printf (’:%8d: \n’. \n’. \n’.456000 : :123. printf (’:%x: \n’.23E+02 : i) i) i) i) i) i) i) i) \n’. printf (’:%-8d: \n’.The next example shows the effect of some format specifications for printing the integer 254: %GCL i = 254 printf (’:%d: \n’. \n’.234560e+02: :1.456 printf (’:%f: printf (’:%15f: printf (’:%-15f: printf (’:%-15. \n’.46 : :1. The output is: :254: : 254: :00000254: :254 : :254 : :fe: :000000FE: :376: The next example shows the effect of some format specifications for printing the floating point number 123.

are optional arguments. SCANF returns -1. but reads the input from a string. is the returned status of SSCANF and can have the values 0 and -1... ... The call is: CFMT ARG1. If a string should be read. is a format string.. On error. 40 .... .ARGn ISTAT = SCANF (CFMT.The call is: CRAY CFMT ARG1. is the returned status of SPRINTF and can have the values 0 and -1. The call is: CSTR CFMT ARG1. . SSCANF returns -1. ARG2. 9. CFMT. are optional arguments (see SCANF). 9. is the returned status of SCANF and can have the values 0 and -1. the corresponding variable must be created with the DISGCL command CHAR and big enough to hold the string and a trailing string terminator. On error.ARGn ISTAT ISTAT = SPRINTF (CRAY.. ARGn) is a character array that must be created with the CHAR command. ARGn) is a format string. ARGn) is a string where the input characters are taken from. It uses the format specifications listed in table 9.. are optional arguments where the arguments must be variables.. CFMT. SPRINTF returns -1.ARGn ISTAT ISTAT = SSCANF (CSTR. ARG2..4 Formatted Input with SSCANF The function SSCANF does the same conversions as SCANF does.1.. ARG1. CRAY must be big enough to hold the result and the string terminator.. is a format string.. On error. ISTAT Note: SCANF cannot be used in the interactive mode of DISGCL. ARG1. ARG2...3 Formatted Input with SCANF The function SCANF is an analog function to PRINTF for formatted input from the keyboard.. ARG1.

On error. Figure 9. the console can only be opened for output (CMOD = ’w’). or -1 if an error occurs.9. REMOVE returns -1. is the returned status of FCLOSE and can have the values 0 and -1. CMOD NU The following table shows the allowed file modes for FOPEN: Mode ’r’ Meaning opens a text file for reading. If CFIL = ’CON:’. If DISGCL is used in interactive mode. FCLOSE returns -1. CMOD) is the name of a file.2: File Modes for FOPEN FCLOSE The function FCLOSE closes a file. REMOVE The function REMOVE deletes a file. 41 . On error. is the returned file unit. is the returned status of REMOVE and can have the values 0 and -1. opens a file for binary writing. The call is: NU ISTAT ISTAT = FCLOSE (NU) is a file unit. The file must exist. The call is: CFIL NU = FOPEN (CFIL. or an error message is printed. ’a’ ’rb’ ’wb’ ’ab’ opens a text file for appending. the console is opened for file I/O. The modes are listed in table 9. The contents of an existing file will be overwritten.2. is a string that defines the mode for file access.5 File Access The following functions deal with operations on files. FOPEN The routine FOPEN opens a file and returns a file unit. opens a file for binary appending. opens a file for binary reading. ’w’ opens a text file for writing. The call is: CFIL ISTAT ISTAT = REMOVE (CFIL) is the name of a file.

On error. REWIND The function REWIND sets the current file position to the beginning of the file. RENAME returns -1. is the returned status of RENAME and can have the values 0 and -1. CNEW) is the old name of the file. FFLUSH has no effect. is the returned status of REWIND and can have the values 0 and -1. On error. is the returned file position.RENAME The function RENAME changes the name of a file. is the new file position. 42 . On error. The call is: NU ISTAT ISTAT = REWIND (NU) is a file unit. On error. or -1 on error. NPOS) is a file unit. FTELL The function FTELL returns the current file position. FSEEK The function FSEEK defines the current file position. is the returned status of FFLUSH and can have the values 0 and -1. The call is: NU NPOS NPOS = FTELL (NU) is a file unit. FSEEK returns -1. is the returned status of FSEEK and can have the values 0 and -1. FFLUSH returns -1. The call is: COLD CNEW ISTAT ISTAT = RENAME (COLD. The call is: NU ISTAT ISTAT = FFLUSH (NU) is a file unit. REWIND returns -1. is the new name of the file. The call is: NU NPOS ISTAT ISTAT = FSEEK (NU. For input. FFLUSH The function FFLUSH flushes any output buffers.

. is the returned status of FSCANF and can have the values 0 and -1. The call is: NU N N = FGETC (NU) is a file unit. FSCANF returns -1.ARGn ISTAT ISTAT = FPRINTF (NU. is the returned status of FPRINTF and can have the values 0 and -1. ARGn) is a file unit.. ARG1. FPRINTF returns -1. The call is: NU CFMT ARG1.. but writes the output to a file.... ARG1. On error. ARG2.8 Text Input and Output Functions FGETC The function FGETC returns the next character from a file. N. are optional arguments.. the corresponding variable must be created with the DISGCL command CHAR and big enough to hold the string and the trailing string terminator.... ARG2. The call is: ISTAT = FGETS (CRAY. NU) 43 .7 Formatted Input from Files FSCANF The function FSCANF is an analog function to FPRINTF for formatted input..ARGn ISTAT = FSCANF (NU. CFMT. 9. are optional arguments where the arguments must be variables. The newline character is included in the character array. is the ASCII code of the returned character. ARGn) is a file unit. is a format string..9.1.6 Formatted Output to Files FPRINTF The function FPRINTF does the same conversions as PRINTF does. stopping if a newline is encountered. The call is: NU CFMT ARG1. or -1 if end of file or error occurs. It uses the format specifications listed in table 9. FGETS The function FGETS reads at most N-1 characters into a character array. On error. CFMT. ISTAT 9. If a string should be read from the file.. . is a format string.

is the returned status of FPUTS and can have the values 0 and -1. NU) is the ASCII code of a character that should be written to a file. FPUTS The function FPUTS writes a string to a file. FPUTS returns -1. On error.CRAY N NU ISTAT is a character array filled by FGETS. On error. is a file unit. 9. is a file unit. is the returned status of FPUTC and can have the values 0 and -1. NU) is an array where the binary data should be filled in. N. is the number of array elements that should be filled with data. FPUTC returns -1. it replaces the terminating newline with ’\0’. The call is: VRAY N NU NRET = FREAD (VRAY. defines the number of characters to be read.e. CRAY must be created with the DISGCL command CHAR (i. Note: The function PUTS (CSTR) prints the string CSTR and a newline on the console. The call is: CSTR NU ISTAT ISTAT = FPUTS (CSTR. is a file unit. is the returned status of FGETS and can have the values 0 and -1. FGETS returns -1 if end of file or error occurs. At most N-1 characters will be read. A newline character is not inserted after the string. FPUTC The function FPUTC writes a character to a file. CHAR CRAY[N]). The call is: N NU ISTAT ISTAT = FPUTC (N. NU) is a string that should be written to the file.9 Binary Input and Output Functions FREAD The function FREAD reads binary data from a file. 44 . is a file unit. Note: The function GETS (CRAY) reads the next input line into the character array CRAY.

100. out) i = fgets (cr. is a file unit. is the number of array elements that should be written to the file. FWRITE The function FWRITE writes binary data to a file. inp) while (i != -1) s = strupr (cr) fputs (s.NRET is the number of elements read. or -1 if error occurs. or -1 if end of file or error occurs. 9. ’r’) if (inp == -1) exit out = fopen (cout. cinp[40]. The call is: VRAY N NU NRET NRET = FWRITE (VRAY. ’w’) if (out == -1) exit i = fgets (cr. NU) is an array containing the data that should be written to the file. cout[40] printf (’Inputfile: ’) gets (cinp) printf (’Outputfile: ’) gets (cout) inp = fopen (cinp. N. inp) end while fclose (inp) fclose (out) The example can be stored in a file and executed with the command: disgcl filename 45 . %GCL // Copies a file and converts it to uppercase letters char cr[100]. 100.10 Example The following example copies a text files and converts it to uppercase letters. is the number of elements written.

46 .

sine of x.Appendix A Intrinsic Functions This appendix is a summary of the DISGCL intrinsic functions. x ≥ 0. -1 ≤ x ≤ 1. x) CEIL (x) COS (x) COSH (x) EXP (x) FLOOR (x) FMOD (x. π ]. tan (y/x)−1 in the range [-π . largest integer not greater than x.1 Mathematical Functions Function ABS (x) ACOS (x) ASIN (x) ATAN (x) ATAN2 (y. sin (x)−1 in the range [0. tangent of x. tan (x)−1 in the range [-π /2. hyperbolic sine of x. Figure A. x > 0. with the same sign as x. √ x. hyperbolic cosine of x. π ]. y) Meaning absolute value | x |. x > 0. π ]. cos (x)−1 in the range [0. smallest integer not less than x. π /2]. floating point remainder of x/y.1: Mathematical Functions 47 . FMOD returns zero if y is zero. LOG (x) LOG10 (x) SIN (x) SINH (x) SQRT (x) TAN (x) TANH (x) natural logarithm ln (x). -1 ≤ x ≤ 1. as a double. hyperbolic tangent of x. cosine of x. as a double. A. base 10 logarithm. exponential function ex .

3 Complex Functions Function ARG (z) CONJG (z) IMAG (z) Meaning returns the phase of z in radians.2 Type Conversion Functions Function ATONUM (s) BYTE (x) CHAR (x) COMPLEX (x.Note: Normally. converts a number x to a string where ndig is the number of decimal places plotted after the decimal point. A. the returned value is also a FLOAT.3: Complex Functions 48 . If x is an array expression of types FLOAT.2: Type Conversion Functions A. INT (x) NUMTOA (x. ndig) converts x to INT. converts x to BYTE. returns the imaginary part of z. DOUBLE or COMPLEX. If x is an array expression of type INT. If x is a scalar expression. the parameter x in a mathematical function can be a scalar or an array expression. Figure A. y) Meaning converts a string to a number. the returned value is a FLOAT array. converts to COMPLEX. SHORT (x) STRING (x) converts x to SHORT. Figure A. converts x to FLOAT. converts x to CHAR. If x is a complex number. converts x to STRING. x is converted to the real. FLOAT returns the real part of x. DOUBLE or COMPLEX array. returns the conjugate of the complex value z. y is converted to the imaginary part. DOUBLE (x) FLOAT (x) converts x to DOUBLE. and may be real or complex. the returned value of a mathematical function has the type DOUBLE or COMPLEX.

’FLOAT’ or ’DOUBLE’. i1 is the first index. n) Meaning Concatenates two arrays. ’INT’. Returns the minimum of an array a.5 Variable and Parameter Functions Function ARGCNT () Meaning returns the total number of parameters passed to a user-defined subroutine or function. Figure A. TRPMAT (a) Exchanges rows and columns of a matrix a. idx is an integer array containing column numbers in the range 0 to n-1 where n is the number of columns in a. Creates a subarry from the array a. VARDIM (v. Returns the maximum of an array a. n) returns the n-th dimension of a variable v. or -1 if v is not defined. n the number of elements of a. Figure A.4: Array Functions A. VARDIM returns zero. KEYCNT () returns the number of keyword parameters passed to a user-defined subroutine or function. SUBMAT (a. If the dimension is not defined. i1. VARCNT (v) returns the number of elements of a variable v. The returned type can have the value ’BYTE’.5: Variable and Parameter Functions 49 . b) MAXARR (a) MINARR (a) SUBARR (a. VARTYP (v) returns the data type of the variable v.A. VARDEF (v) returns 1 if the variable v is defined. idx) Creates a submatrix from certain columns of the two-dimensional array a. or the string ’UNDEF’ if v is not defined.4 Array Functions Function CATARR (a. and 0 if v is not defined.

IALLOC (n) creates an integer array and initializes it with {0.7: Memory Allocating Functions 50 . ’COLUMNS’. .. DATRAY (ncolumn) returns an array containing a column of the current data block.. . DATMAT () returns an array containing the whole current data block.6: Data File Functions A.}. 1.7 Memory Allocating Functions Function DALLOC (n) Meaning creates a double array and initializes it with {0. ’FULL’ and ’BLOCKS’. DATHDR returns -1 if it fails.A. n-1}.... FALLOC (n) creates a floating point array and initializes it with {0. n-1......}.. DATCNT (copt) returns the number of data in the current data block. DATFIL (s) defines the data file.. Figure A. copt can have the values ’ROWS’. It returns -1 if the data block n is not defined.6 Data File Functions Function DATBLK (n) Meaning defines the current data block... .. 1. Figure A.... n-1. DATHDR () prints the header of a data file on the screen. 1.. It returns -1 if it fails. DATVAR (cname) returns the value of a variable defined in the header of a data file.

REMOVE (cfile) RENAME (cold. n) returns a string converted to uppercase letters. npos) sets the current file position.A. It returns -1 on error. It returns -1 if the attempt fails.8: String Functions A. It returns -1 if any errors occured. changes the name of a file. STRUPR (s) SUBSTR (s. returns n copies of the string s. returns the first occurence of string s2 in string s1.9: File Functions 51 . Figure A. or -1 if the open fails. It returns -1 if the attempt fails. FFLUSH (nu) FOPEN (cfile. It returns -1 on error. REWIND (nu) rewinds the file with the unit nu.8 String Functions Function STRLEN (s) STRLWR (s) STRREP (s. returns a substring of s where i1 is the starting index and n the number of characters of s. i1. opens a file and returns a file unit. tests if a file exists. returns a string converted to lowercase letters. FTELL (nu) INQUIRE (cfile) returns the current file position. cnew) deletes a file. or -1 if not present. TRMLEN (s) returns the length of a string without trailing blanks. FSEEK (nu. cmode) flushes any output buffers. It returns 0 on error.9 File Functions Function FCLOSE (nu) Meaning closes the file with the unit nu. or -1 on error. s2) Meaning returns the length of a string. n) STRSTR (s1. Figure A. otherwise 1.

s.10: Input/Output Functions 52 . or -1 if an error occurs. n. or -1 if an error occurs. vlist) SPRINTF (cr. Figure A. FPUTS (cbuf. FREAD returns the number of elements read. vlist) writes formatted output to the terminal. vlist) SCANF (s.10 Input and Output Functions Function FGETC (nu) Meaning returns the next character from a file. n. FPUTS returns -1 if an error occurs. The newline is included in the array. s. PUTS (cbuf) prints the string cbuf on the screen. vlist) writes formatted output to a file connected to the unit nu. FPRINTF (nu. FWRITE returns the number of elements written. The newline not is included in the array. nu) writes the string cbuf to a file. vlist) reads formatted input from a file connected to the unit nu. nu) reads from a file n elements into the array a. FREAD (a. stopping if a newline is encountered.A. FPUTC (i. GETS returns -1 if an error occurs. nu) writes from the array a n elements to the file with the unit nu. PUTS returns -1 if an error occurs. FSCANF (nu. FWRITE (a. FGETS returns -1 if end of file or error occurs. FPUTC returns 0 if successful. PRINTF (s . n. vlist) SSCANF (s1. FGETS (cbuf. FGETC returns -1 if end of file or error occurs. s2. s. reads formatted input from a string. reads formatted input from the console. nu) writes the character with the ASCII value i to a file. nu) reads at most n-1 characters into the array cbuf. A newline is printed after the string. writes formatted output to a character array. GETS (cbuf) reads the next input line into the character array cbuf. or -1 if an error occurs.

GETPID () SYSTEM (cmd) returns the process ID of the DISGCL executable. or blank if no string exists. Figure A. DATE () returns a string containing the date in the format dd. At the first time. SYSTEM returns -1 if it fails. CLOCK returns 0. Figure A.A. The generator is initially seeded with a value of 1.13: Random Number Functions 53 .yy TIME () returns a string containing the time in the format hh:mm:ss.13 Random Number Functions Function RAND () SRAND (iseed) Meaning returns a random number in the range from 0 to 1.11: System Functions A.11 System Functions Function GETENV (cenv) Meaning returns the environment string associated with cenv. Figure A. It resets the random-number generator to a random starting point. executes the system command cmd where cmd is a character variable. sets the seed for rand.12 Time Functions Function CLOCK () Meaning returns the processor time in seconds used by the DISGCL session since the last call of CLOCK.mm.12: Time Functions A.

54 .

clears the screen. enables transparency for GIF files. nh) . nw) HWSCAL (xscl) IMGFMT (copt) INCFIL (cfil) METAFL (cfmt) NEWPAG () ORIGIN (nx. sets the page size. defines the plotfile format. For parameters. INT and FLOAT arrays must be passed to DISLIN routines. sets the picture ID for CGM files. ny. creates a new page. A complete description of the routines can be found in the DISLIN manual or via the online help of DISGCL. initializes DISLIN. ckey) CGMBGD (xr. xg. modifies the scale operator in PostScript files.1 Initialization and Introductory Routines Routine Meaning defines the physical resolution of BMP files. ckey) HWORIG (nx. defines the error device. B. ckey) HPGMOD (cmod. ny) HWPAGE (nw. defines the position and size of included metafiles. ckey) GIFMOD (cmod. includes metafiles into a graphics. modifies rules for creating file versions. copt) BUFMOD (cmod. copt) FILBOX (nx. defines the origin. ny) PAGE (nw. 55 BMPMOD (n. modifies the printing of error messages. defines options for HPGL files. cval. nh) FILOPT (copt. modifies the behaviour of the output buffer. defines the size of the PostScript hardware page. the following conventions are used: integer variables begin with the character N or I strings begin with the character C other variables can be integers or floating point numbers. defines the format of image files. arrays end with the keyword ’ray’. defines the DISLIN environment. nw. Normally. defines the origin of the PostScript hardware page. sets the name of the error file. xb) CGMPIC (cstr) DISENV (cenv) DISINI () ERASE () ERRDEV (cdev) ERRFIL (cfil) ERRMOD (ckey.Appendix B Short Description of DISLIN Routines This appendix presents a short description of all DISLIN routines that can be called from DISGCL. defines the background colour for CGM files.

plots a page header. selects a page rotation. defines the logical unit for messages. 56 ANGLE (n) CHAANG (x) CHASPC (x) CHAWTH (x) FIXSPC (x) FRMESS (nfrm) HEIGHT (n) MESSAG (cstr. defines the thickness of text frames. defines an inclination angle for characters.and foreground colours. ckey) Meaning fills the page with a colour. sets a constant character width. defines the physical resolution of TIFF files. terminates an axis system and sets the level to 1. flushes the output buffer. sets the plotfile name. copt) SYMFIL (cdev.1: Initialization and Introductory Routines B. idir) PAGMOD (copt) PAGORG (copt) n = PDFBUF (cbuf. resets parameters to default values. ny) . modifies the format of WMF files. plots text. cval. defines an external X Window or pixmap. ckey) SCLFAC (x) SCLMOD (copt) SCRMOD (copt) SENDBF () SETFIL (cfil) SETPAG (copt) SETXID (id.3 Plotting Text and Numbers Routine Meaning defines the character angle. ckey) PDFMRK (cstr. nmax) PDFMOD (cmod. Figure B. defines kookmarks for PDF files. Figure B. defines a scaling mode. nx. copt) UNIT (nu) UNITS (copt) WMFMOD (cmod. affects the width of characters.Routine PAGFLL (iclr) PAGERA () PAGHDR (c1. c2.2: Termination and Parameter Resetting DISFIN () ENDGRF () RESET (copt) B. copies a PDF file to a buffer. copt) PNGMOD (cmod. defines PDF options. affects character spacing. sends a plotfile to a device. defines the plot units. plots a page border. iopt. selects a predefined page format. cstat) TIFMOD (n. swaps back. enables transparency for PNG files. defines the character height.2 Termination and Parameter Resetting Routine Meaning terminates DISLIN. defines the origin of the page. defines a scaling factor for the entire plot.

xg. xg. xv) SETCLR (nclr) SETIND (i. xs. defines control signs for indices and exponents.Routine MIXALF () NEWMIX () n = NLMESS (cstr) NUMBER (x. defines a background colour for text and numbers. xb. enables TeX mode for plotting mathematical formulas. y) RLNUMB (x. xb) SETVLT (cvlt) VLTFIL (cfil. xb) n = INDRGB (xr. plots text for user coordinates. selects a colour table. x. cmix) TEXMOD (cmode) TEXOPT (copt. c3. defines colours. xr. xv. stores or loads a colour table. Figure B.3: Plotting Text and Numbers B. gray. xg. changes the current colour table. calculates an explicit colour value. returns the length of strings in plot coordinates. defines the alignment of text and numbers. plots floating point numbers. ny) NUMFMT (copt) NUMODE (c1. ndig. xb) n = INTRGB (xr. ndig. xb) SETRGB (xr. converts RGB to HSV coordinates. plots numbers for user coordinates. ctype) TEXVAL (x. xg. defines an alternate set of control characters. defines TeX values.4: Colours COLOR (color) HSVRGB (xh. xp. c2. n) RGBHSV (xr. sets height of indices and exponents. defines TeX options. modifies the appearance of numbers. determines the format of numbers. xr. xb) MYVLT (rray. changes the current colour table. copt) TXTBGD (nclr) TXTJUS (copt) Meaning enables control signs for plotting indices and exponents. xs. cmod) 57 . nx. yp) SETBAS (xfac) SETEXP (xfac) SETMIX (char. converts HSV to RGB coordinates. defines colours. determines the position of indices and exponents. calculates a colour index.4 Colours Routine Meaning defines the colour used for text and lines. xh. c4) RLMESS (cstr. xg. bray. Figure B. xg.

sets a shaded font. enables Greek and Italic characters for PostScript fonts. sets a PostScript font. sets a complex font. defines an user-defined symbol. defines a bitmap font. copt) B. x. defines a rotation angle for symbols. Figure B. defines shift characters for alternate alphabets.5: Fonts BASALF (calph) BMPFNT (cfont) CHACOD (copt) COMPLX () DUPLX () DISALF () EUSHFT (cnat. defines the character coding.6 Symbols Routine Meaning defines the height of symbols. sets a shaded font with small characters. sets a gothic font.6: Symbols HSYMBL (n) MYSYMB (xray. defines a shift character for European characters. sets a standard hardware font. sets a triple-stroke font. sets a complex shaded font. loads a TrueType font. c1. sets the default font.5 Fonts Routine Meaning defines the base alphabet.B. n) TRIPLX () TTFONT (cfont) WINFNT (cfont) X11FNT (cfont. y) SYMBOL (nsym. c2. char) GOTHIC () HELVE () HELVES () HWFONT () PSFONT (cfont) PSMODE (cmode) SERIF () SIMPLX () SMXALF (calph. sets a TrueType font. nx. isym. sets a single-stroke font. plots symbols for user coordinates. n. ny) SYMROT (xang) 58 . sets an X11 font for X11 displays. sets a double-stroke font. Figure B. plots symbols. iflag) RLSYMB (nsym. yray.

defines axis lengths for a 2-D axis system. ystp) GRAF3 (xa. defines the frame thickness of axis systems.7 Axis Systems Routine Meaning plots additional single labels.and the left Y-axis. xor. ystp. plots a polar grid. ystp) GRDPOL (nx. defines the background colour. determines the position of axis systems. plots a two-dimensional axis system. copt. cax) TITLE () XAXGIT () XCROSS () YAXGIT () YCROSS () plots a polar axis system. v2. nyl) AXSORG (nx. modifies the appearance of polar labels. ya. ny) AXSPOS (nxp. suppresses the plotting of the upper X. defines axis lengths for a coloured 3-D axis system. plots the line Y = 0. a. ny) GRID (nx. xor. nzl) AXGIT () AXSBGD (iclr) AXSLEN (nxl. determines the position of a crossed axis system. ADDLAB (cstr. c4) SETSCL (xray. centres axis systems. yor. ye. za. plots the lines X = 0 and Y = 0. zor. xstp.B. n. ye. c3. ze. yor. plots the line X = 0 and marks it with ticks. ya. xe. plots the line X = 0. plots the lines X = 0 and Y = 0 and marks them with ticks. select rectangular or crossed axis systems. overlays a grid on an axis system. xstp. xstp. b. suppresses clipping of user coordinates. yor. plots the line Y = 0 and marks it with ticks. plots an axis system for colour graphics. plots a border around an axis system. c2. cax) AX2GRF () AX3LEN (nxl. calculates axis parameters. terminates an axis system. ny) NOCLIP () NOGRAF () POLMOD (cpos. zstp) GRAFP (xe. stp. nyp) AXSTYP (ctype) BOX2D () CENTER () CROSS () ENDGRF () FRAME (nfrm) FRMCLR (nclr) GAXPAR (v1. ndig) GRACE (ngrace) GRAF (xa. defines the colour of frames. v. cdir) SETGRF (c1. xe.7: Axis Systems 59 . cax. affects the clipping margin of axis systems. suppresses parts of an axis system. itic. xor. or. nyl. suppresses the plotting of an axis system. sets automatic scaling. plots a title over an axis system. Figure B.

xstp. cax) HNAME (nh) INTAX () LABDIG (ndig. modifies date labels. plots a linear Y-axis. cax) AXENDS (copt. it. xe. modifies the appearance of logarithmic ticks. ny) Figure B. it. ystp nl. plots a logarithmic Y-axis. xstp. itic. ze. selects labels. it. defines the axis scaling. ny) ZAXLG (za. cstr. cax) LABDIS (ndis. nl. id. cstr. sets the distance between labels and ticks. id. nl. ystp. sets user-defined labels. ny) XAXLG (xa. ye. sets the number of ticks. cax) LABPOS (copt. it. sets the number of decimal places for labels. defines vertical or horizontal labels. cax) NAME (cstr. cax) LOGTIC (copt) MYLAB (cstr. defines integer numbering for all axes. right-justifies labels. plots a linearly scaled colour bar. ye. nx. nx. nl. zor. zstp.8 Secondary Axes Routine Meaning plots a linear X-axis. defines the alignment of axis labels. nx. defines the alignment of axis titles. xor. copt. suppresses certain labels. ny) YAXIS (ya. cax) NAMJUS (copt. 60 AXCLRS (nclr. cax) LABELS (copt. xor. cstr. nl. cax) AXSSCL (copt. cax) LABMOD (ckey. it. ny) YAXLG (ya. xe. cval. suppresses the plotting of axis lines. ny) ZAXIS (za. nx. cax) LABJUS (copt. defines axis titles. cax) LABTYP (copt. plots a logarithmically scaled colour bar. cstr. zor. zstp. yor. ze. defines an angle for Y-axis names. yor. it. determines the position of labels. cax) NOLINE (cax) RGTLAB () RVYNAM () TICKS (ntics. defines the character height of axis names. nx. nx. cax) NAMDIS (ndis. cax) TICLEN (nmaj. XAXIS (xa.8: Secondary Axes B. modifies the plotting of ticks at calendar axes. cstr. sets the distance between axis names and labels. nmin) TICMOD (copt.B. cstr. plots a logarithmic X-axis. sets the length of ticks.9 Modification of Axes Routine Meaning defines colours for axis elements. nl. cax) .

defines the number of curves plotted with equal attributes. defines attributes changed automatically by CURVE. x3ray. n. left-justifies title lines. sets modes for the LIC algorithm. zray. e2ray.9: Modification of Axes B. x4ray. plots coloured rectangles. n) CHNATT () CHNCRV (copt) CRVMAT (zmat. icray. ilin) TITPOS (copt) VKYTIT (nshift) B. zray. yray. plots 3-D bars. n) CURVE3 (xray. xwray. selects symbols or lines for CURVE. y2ray. n) BARS3D (xray.11 Plotting Data Points Routine Meaning plots a bar graph. 61 BARS (xray. plots columns of coloured rectangles. x2ray. y1ray. x2ray. yray. plots error bars. iypts) CURVE (xray. n) FBARS (x1ray. changes curve attributes. y2ray. plots rows of coloured rectangles. ixpts. plots curves. y1ray. ywray. Figure B. plots a vector field. n) CURVX3 (xray. defines text lines for titles. yray. yray. e1ray. cax) TIMOPT () Meaning determines the position of ticks. defines gaps plotted by CURVE. ivec) GAPCRV (xgap) INCCRV (ncrv) INCMRK (nmrk) LICMOD (cmod. n) CURVY3 (x.10 Axis System Titles Routine Meaning defines the character height of titles. z1ray. defines line spacing. n) FIELD (x1ray. z2ray. n) ERRBAR (xray. ckey) . m. n. modifies time labels. x5ray. plots axis system titles. yray. y. Figure B. plots a coloured surface. zray. shifts titles in the vertical direction. defines the position of titles. plots financial bars.Routine TICPOS (copt.10: System Titles HTITLE (nh) LFTTIT () LINESP (xfac) TITJUS (copt) TITLE () TITLIN (cstr. defines the alignment of titles.

nlin. xpray. 62 FRAME (nfrm) LEGBGD (nclr) LEGEND (cbuf. ncor) LEGINI (cbuf. initializes legends. sets streamline modes. n2) SPLMOD (ngrad. xsray. i1ray. y1ray. plots legends. defines the interpolation method used by CURVE. nmax. xray. i3ray. nmaxln) LEGLIN (cbuf. ny. xf2. n) STMTRI (xvray.12 Legends Routine Meaning sets the frame thickness of legends. y0. yray. ny) SHDCRV (x1ray. x2ray. ckey) n = STMPTS (xvmat. ypray. nx. ypray. ysray. nx. suppresses listing of out of range data points. xf3) . x0. ntri. ny. ivec) VECMAT (xvmat. n) THKCRV (nthk) TXTURE (itmat. wmat) MARKER (nsym) MRKCLR (nclr) NOCHEK () PIEGRF (cbuf. xpray. ypray. xpray.11: Plotting Data Points B. nlin. n. plots a pie chart. modifies the appearance of legends. ypray. ypray. nray) STMVAL (x. y2ray. yvmat. resets curve attributes. n. plots streamlines from triangulated data. iwmat. defines text for legend lines. xpray. defines the colour of symbols plotted by CURVE. ivec) Meaning calculates a Line Integral Convolution image of a vector field. xray. ckey) STMOPT (n. i2ray. defines the background colour of legends. nx. plots streamlines. ny. defines the thickness of curves. nx. ckey) STREAM (xvmat. xpray. n. plots a vector field. n) POLCRV (copt) RESATT () SETRES (nx. ny) VECFLD (xvray. plots a vector field on a regular grid. ilin) LEGOPT (xf1. modifies spline interpolation. cstr. plots shaded areas between curves. ysray. ypray. yvamt. sets the size of coloured rectangles. yvray.Routine LICPTS (xvmat. ny. Figure B. yvray. sets the symbols plotted by CURVE. generates a streamline. n1. nx. npts) STMMOD (cmod. defines integer options for streamlines. xsray. itmat. generates a texture array for LICPTS. yvmat. yvmat. defines floating point options for streamlines.

Figure B.Routine LEGPAT (ityp. defines colours for line styles. defines the legend title. sets the pen width. selects a shading pattern. defines horizontal or vertical legend lines.12: Legends B. sets a user-defined line style. ilin) LEGPOS (nxp. sets the line width. nyp) LEGTIT (ctitle) LEGTYP (ctype) LEGVAL (x. sets a dotted line style. sets a solid line style. sets a long-dotted line style. isym. ithk. sets the line join parameter. Meaning determines the position of legends. ckey) LINCLR (nray. ipat. ityp. returns the width of legends in plot coordinates. n) MYPAT (iang. sets a dashed-dotted line style. iden. modifies the appearance of legends. sets the miter limit parameter. sets a medium-dashed line style. n) LINTYP (itype) LINWID (nwidth) LNCAP (copt) LNJOIN (copt) LNMLT (xfac) MYLINE (nray. icross) PENWID (nwidth) SHDPAT (ipat) SOLID () Figure B. defines a line style. sets a dashed line style. returns the height of legends in plot coordinates. CHNDOT () CHNDSH () COLOR (color) DASH () DASHL () DASHM () DOT () DOTL () HWMODE (cmod. enables multiple text lines in legends. sets a colour. copt) LINESP (xfac) MIXLEG () nxl = NXLEGN (cbuf) nyl = NYLEGN (cbuf) stores curve attributes. sets the line cap parameter.13 Line Styles and Shading Patterns Routine Meaning sets a dotted-dashed line style.13: Line Styles and Shading Patterns 63 . defines a global shading pattern. enables or disables hardware features for line styles and shading patterns. affects line spacing. sets a long-dashed line style. iclr.

affects the shifting of plot vectors. enables or disables shielded areas. affects the 3-D rotation of plot vectors. t) id = SHLIND () SHLPIE (nx. a.15: Base Transformations TR3AXS (x. a) TR3RES () TR3ROT (xrot. ny) B. yshf. resets base transformations. nw.B. iclr) LINCYC (index. ny. ipat) B. ny. modifies the line style cycle. nb.16 Shielding Routine Meaning defines automatic shielding. nw. yrot. affects the rotation of plot vectors.14: Cycles CLRCYC (index. deletes shielded areas. deletes shielded areas. nh) SHLRES (n) SHLVIS (id. cmode) B. resets 3-D base transformations. yscl) TRFSHF (nx. defines rotated rectangles as shielded areas. b) SHLPOL (nxray. t) SHLREC (nx. Figure B. modifies the pattern cycle. ny. ny) TRFSCL (xscl. returns the current angle used for text and numbers. nh. nr) SHLDEL (id) SHLELL (nx. zscl) TR3SHF (xshf. defines circles as shielded areas. nx. ny. returns the index of a shielded area. na. affects the 3-D shifting of plot vectors. Figure B. defines ellipses as shielded areas. defines pie segments as shielded areas. zrot) TR3SCL (xscl. itype) PATCYC (index. Figure B. nr. affects the 3-D scaling of plot vectors. cmode) SHLCIR (nx. z. defines polygons as shielded areas.16: Shielding SHIELD (carea.15 Base Transformations Routine Meaning defines a rotation about an arbitrary axis. affects the scaling of plot vectors.14 Cycles Routine Meaning modifies the colour cycle. yscl. ny. defines rectangles as shielded areas. nyray. 64 calf = GETALF () n = GETANG () . y. zshf) TRFRES () TRFROT (xang. n) SHLRCT (nx.17 Parameter Requesting Routines Routine Meaning returns the base alphabet.

17: Parameter Requesting Routines 65 . returns the number of ticks plotted between labels. returns the position and size of the graphics window. returns the character height of axis titles. returns the current lengths used for shifting. nmin) GETTIC (nx. returns the RGB coordinates for a colour index. ny) n = GETPAT () GETPOS (nx. cax) n = GETHGT () n = GETHNM () GETIND (i. returns the RGB coordinates of the current colour. returns the current unit used for messages. Figure B. nz) GETSYM (nsym. nh) n = GETCLR () GETDIG (nx. xg. nw. returns the width of colour bars. nxbar. ny) GETPAG (nx. nz) GETSCR (nwpix. returns the screen size in pixels. ny) GETRAN (nx. ny. returns the current page size. returns the current labels. returns the distance between axis ticks and labels. nh) id = GETXID (’WINDOW’) n = GMXALF (copt. returns the current character height. c1. nybar) cvlt = GETVLT () n = GETWID () GETWIN (nx. returns the X window ID. returns shift characters for indices and exponents. returns the current origin. nz) GETSP2 (nx. returns the DISLIN version number. stp. nh) GETTCL (nmaj. returns the size of points used in 3-D colour graphics. returns the current file format. returns the current line width. returns the current colour number. cz) GETLEN (nx. returns the current colour table. or. returns the current plotfile name. ny) GETRES (nx. returns the current axis scaling. ny. nz) cdsp = GETDSP () cfil = GETFIL () GETGRF (a. cy. xb) GETLAB (cx. xg. ny. nz) n = GETLEV () n = GETLIN () cmfl = GETMFL () c = GETMIX (copt) GETOR (nx. returns the current level.Routine GETCLP (nx. returns the position of the axis system. returns the current axis lengths. nw. returns shift characters for additional alphabets. xb) GETSCL (nx. returns the current symbol number and height. returns the current tick lengths. ny) GETRGB (xr. ny. ny. returns the terminal type. returns the range of colour bars. returns the current shading pattern. nhpix) c = GETSHF (copt) GETSP1 (nx. returns the distance between axis labels and names. ny. returns the current line style. ny. nz) n = GETTYP () n = GETUNI () x = GETVER () GETVK (nytit. b. c2) Meaning returns the currents clipping window. returns shift characters for European characters. returns the number of decimal places used in labels. xr. returns the scaling of the current axis system. ny.

plots elliptical arcs for user coordinates. plots lines for user coordinates. iv) RLWIND (x. v) RLPIE (x. ncol) STRTPT (x. xw. alpha. nr1. ARCELL (nx. plots solid filled rectangles. b. y. plots a line to a point. plots vectors for user coordinates. nw.18: Elementary Plot Routines 66 . nv. r1. nc) RECFLL (nx. nc) RLVEC (x1. yp. plots pie segments. y. nh. plots rectangles for user coordinates. r. ny. suppresses the outline of geometric figures. nc) RLREC (x. nh. nw. plots rectangles. r1. nb. r2) RLINE (x. r) RLELL (x. a. plots lines.18 Elementary Plot Routines Routine Meaning plots elliptical arcs. ny. nr2. nu. ny. y1. ny. iv) WINDBR (x. n) CIRCLE (nx. a) SECTOR (nx. beta. b. plots wind speed symbols for user coordinates. xp. y. nr) CONNPT (x. y. nv) NOARLN () PIE (nx. a. y. n) RLCIRC (x. nc) RECTAN (nx. plots circles for user coordinates. moves the pen to a point. plots wind speed symbols. na. r2. ny. nh. icray. plots coloured rectangles. plots polygons. y) XDRAW (x. yray. nr1. nw. plots coloured pie sectors for user coordinates. nb. t) RLAREA (xray. ckey) VECTOR (nx. ny. theta) AREAF (nxray. nw. plots a line to a point. yray. x2. y. yray) VECCLR (nclr) VECOPT (xopt. plots coloured rectangles for user coordinates. y. ny. defines vector options. ny. nw. nw. y) ELLIPS (nx. nh) RNDREC (nx. ny. nh. ny. defines coulour for arrow heads. ny. nr2) LINE (nx. nu. plots ellipses for user coordinates. a. plots ellipses. y. a. plots coloured rectangles where the position is defined by the centre point. plots solid filled rectangles. a) XMOVE (x. plots a rectangle with rounded corners. nyray. y) TRIFLC (xray. nx. y. xh. nr. moves the pen to a point. xw. r2. b. u. a. plots circles. ny. b) POINT (nx. iopt) RLSEC (x. xh) RLRND (x. r1. plots for user coordinates a rectangle with rounded corners. b) RLPOIN (x. y2. y) Figure B. plots vectors. plots polygons for user coordinates. plots coloured pie sectors. plots pie segments for user coordinates.B. n) TRIFLL (xray. i) RLARC (x.

converts two-dimensional coordinates. y3. iinp. converts three-dimensional coordinates. ym. xhray. n2. converts X plot coordinates to user coordinates. zray. yray. ypray. yray. n.20 Utility Routines Routine Meaning calculates a Bezier interpolation. converts X plot coordinates to pixel. n. yray. iinp. x3. xpray. converts Z-coordinates to colour numbers. ninp. nout. COLRAY (zray. n) x = XINVRS (nx) x = XPOSN (x) y = YINVRS (ny) y = YPOSN (y) Figure B. n. cstr. n. y2ray. n. cfrom. cfrom. converts Y plot coordinates to pixel. mx. cto) TRFREL (xray. cto) TRFCO2 (xray. iout) n = BITSI4 (nbits. y1. np) n = BITSI2 (nbits. nray. ndig) POLCLP (xray. cstr) n = INTLEN (nx) INTUTF (iray. calculates a circle specified by 3 points. converts X-coordinates to plot coordinates.19: Conversion of Coordinates B. clips a polygon. n. ndig. yhray. r) n = FCHA (x. 67 BEZIER (xray. yray.and Y-coordinates to plot coordinates. returns the length of character strings in plot coordinates. converts floating point numbers to character strings. cstr) n = FLEN (x. calculates a histogram. ndig) HISTOG (xray. returns the length of numbers in plot coordinates. allows bit manipulation on 16 bit variables. cto) TRFCO3 (xray. y2. n. converts Unicode numbers to an UTF8 string. yray. converts X. yray. cfrom. nray. calculates the number of digits for floating point numbers. n) n = NXPIXL (ix.B. converts X-coordinates to real plot coordinates. converts Y-coordinates to plot coordinates. ninp. copt) . iy) n = NXPOSN (x) n = NYPIXL (ix. x2ray. nout. nmax. converts Y-coordinates to real plot coordinates.19 Conversion of Coordinates Routine Meaning converts Z-coordinates to colour numbers. n. allows bit manipulation on 32 bit variables. nh) n = INTCHA (nx. converts integers to character strings. sorts floating point numbers. converts one-dimensional coordinates. n) n = NLMESS (cstr) n = NLNUMB (x. calculates the number of digits for integers. xm. x2. sorts points in the X-direction. cedge) SORTR1 (xray. copt) SORTR2 (xray. iy) n = NYPOSN (y) n = NZPOSN (z) TRFCO1 (xray. iout) CIRC3P (x1. converts Y plot coordinates to user coordinates.

calculates the Delaunay triangulation. yray. Figure B. ny. ny2) CSRMOV (nxray. n) Meaning returns splined points as calculated in CURVE. selects the unit of returned cursor positions. selects the cursor type. converts an UTF8 string to Unicode numbers. nyray. ysray. collects cursor movements. iret) nkey = CSRPOS (nx. im.20: Utility Routines B. yray. i2ray. n. converts incremented days to a date. Figure B. iy) n = INCDAT (id. xsray. swaps the bytes of 32 bit integer variables. defines the cursor type of the graphics window. n. im. zmat2. nyray. returns the end points of a line. nmax. nmax. sets and returns the cursor position. iray. n. converts a character string to uppercase letters. returns opposite corners of a rectangle. nx. n) SWAPI4 (iray. nspl) SWAPI2 (iray. returns incremented days. ny2) ntri = TRIANG (xray. swaps the bytes of 16 bit integer variables. iy) B. iy) TRFDAT (n. i3ray. nx2. ny1.22: Cursor Routines n = CSRKEY () CSRLIN (nx1. nx2. nray. returns the weekday of a date.Routine SPLINE (xray. returns a pressed cursor position. ny1.22 Cursor Routines Routine Meaning returns a character key. iret) CSRREC (nx1. i1ray. Figure B. n) TRFMAT (zmat.21 Date Routines Routine Meaning defines the base date. im. ny) CSRPTS (nxray. calculates the number of characters in character strings. nx2. im. ny) CSRPT1 (nx. id. converts matrices. ny2) CSRTYP (copt) CSRUNI (copt) SETCSR (copt) 68 . iy) n = NWKDAY (id.21: Date Routines BASDAT (id. collects cursor positions. n. nmax) n = TRMLEN (cstr) UPSTR (cstr) UTFINT (cstr.

gap) BARMOD (cmod. Figure B. ang) PIEROT (angle) . modifies alpha blending. copt) BAROPT (xf. modifies the appearance of 3-D pies. defines exploded pie segments. ic2ray. n) BARTYP (copt) CHNBAR (copt) LABCLR (nclr.23: Transparency TPRFIN () TPRINI () TPRMOD (cmode. 69 CHNPIE (copt) LABCLR (nclr.23 Transparency Routine Meaning terminates alpha blending. modifies the appearance of segment labels. ’BARS’) LABDIG (ndig. sets additional character strings plotted in segment labels. defines bar colours. ’BARS’) B.24 Bar Graphs Routine Meaning defines the colour of bar borders.25 Pie Charts Routine Meaning defines colour and pattern attributes for pie segments. ’PIE’) LABTYP (copt. y1ray. Figure B. defines the colour of bar labels. defines the position of bar labels. nlin. selects predefined positions for bars. defines the colour of pie borders. ’BARS’) LABPOS (copt. ic2. ’PIE’) LABPOS (copt. ’PIE’) PIEBOR (iclr) PIECBK (crout) PIECLR (ic1ray. cpos) PIEOPT (xf. defines the colour of segment labels. plots pie charts. ’BARS’) LABELS (copt. enables variable bars.B. n) PIELAB (clab. ic3) BARGRP (ngrp. defines the position of segment labels. sets the alpha value. defines bar labels. defines the number of decimal places in bar labels. ckey) TPRVAL (x) B. defines the number of decimal places in segment labels.24: Bar Graphs BARBOR (iclr) BARCLR (ic1. sets a rotation angle for 2-D pie charts. defines a callback routine for PIEGRF. plots bar graphs. ’PIE’) LABDIG (ndig. xray. defines pie colours. selects vertical or horizontal bars. n) PIEEXP () PIEGRF (cbuf. affects clustered bars. modifies the appearance of 3-D bars. ang) BARPOS (copt) BARS (xray. initializes alpha blending. ’PIE’) LABELS (copt. modifies the appearance of bars. y2ray. defines pie labels.

yor. nb. ye. AX3LEN (nx. y. ny. b. nh. sets the position of colour bars. zray. plots coloured rectangles for user coordinates. nc) RLPOIN (x. nr2. y. modifies the arrow plotted between labels and segments. defines the size of coloured rectangles. i1ray. r1. zray. defines the thickness of frames around colour bars. nc) RLSEC (x. ny. i2ray. b. xor. zray. plots rows of coloured rectangles. m. plots a coloured surface. ystp. suppresses the plotting of points which have the same colour as the background. r2. ckey) PIEVEC (ivec. n. yray. ixpts. plots coloured rectangles.Routine PIETYP (copt) PIEVAL (x. za. y. a. ny.25: Pie Charts B.26 Coloured 3-D Graphics Routine Meaning defines axis lengths. nr1. shifts colour bars in the Y-direction. a. ncol) SECTOR (nx. n) CURVX3 (xray. i3ray. zor. copt) Meaning selects 2-D of 3-D pie charts. ntri) CURVE3 (xray. defines colours. 70 . xe. ny) SPCBAR (nspc) VKXBAR (nshift) VKYBAR (nshift) defines the alignment of colour bars. nz) COLOR (color) COLRAN (nx. nw. plots the coloured surface of a Delaunay triangulation. nh. nh. Figure B. sets the space between colour bars and axis systems. shifts colour bars in the X-direction. suppresses the plotting of colour bars. xstp. modifies parameters for pie charts. n) CURVY3 (x. n. n) ERASE () FRMBAR (nfrm) GRAF3 (xa. plots coloured quadrangles. plots coloured rectangles where the position is defined by the centre point. zray. zray. erases the screen. yray. yray. n) CRVTRI (xray. defines the range of colour bars. nw. zstp) JUSBAR (copt) NOBAR () NOBGD () n = NZPOSN (z) POINT (nx. ze. plots columns of coloured rectangles. converts a Z-coordinate to a colour number. ya. nc) POSBAR (copt) RECFLL (nx. plots coloured pie sectors. plots coloured pie sectors for user coordinates. yray. ny. plots a coloured axis system. ny) CRVMAT (zmat. ncol) SETRES (nx. plots coloured rectangles. iypts) CRVQDR (xray.

ny. ze. zray. zlvray. id. defines the lengths of the 3-D box. zor. plots a disk. m. plots a line to a point in 3-D space. n. plots a grid. calculates colour values. zor. Figure B. initializes a depth depth sort. yn. yor. plots a cylinder. plots an axis system. n. icray. xwray. wmat) GRAF3D (xa.Routine WIDBAR (nw) ZAXIS (za. it. ny) ZAXLG (za. ny. nx. y1ray. y. zray. nx. n) CURV4D (xray. zn) GETMAT (xray. plots a border around the 3-D box. plots 3-D contours. initializes projections in 3-D space. h. sets the height of 3-D symbols. yray. terminates a projection into 3-D space. x3. m) CONN3D (x. zm. zmat. n) BOX3D () CONE3D (xm. h2. y. y2ray. imat. id. r1. n. zray. zstp. z1ray. ivec) FLAB3D () n = GETLIT (x. zm.27 3-D Graphics Routine Meaning converts absolute 3-D coordinates to plot coordinates. y1. y. ystp. x2. yray. nl. cstr. zv. ye. za. xor. xe. nl. m) FIELD3D (x1ray. plots a cone. zstp) GRFFIN () GRFINI (x1. z. disables the suppression of axis labels. r2. z. y. plots a vector field. y3. plots a linearly scaled colour bar. 71 ABS3PT (x. ze. terminates a depth sort. it. x2ray. r. yp) AXIS3D (x. z3) GRID3D (nx. r. ywray. z2ray. n. h1. ym. nx. plots coloured 3-d symbols. yray. ym. m) DBFFIN () iret = DBFINI () DBFMOD (cmod) DISK3D (xm. zm.26: Coloured 3-D Graphics B. z2. cstr. copt) HSYM3D (xh) . ya. calculates a function matrix from randomly distributed data points. n. ny) Meaning defines the width of colour bars. z1ray. y. y2. ym. ze. zor. z) zmat. z2ray. n. wray. z) CONSHD3D (xray. plots curves or symbols. plots 3-D bars. z1. yray. plots a logarithmically scaled colour bar. xstp. can disable the depth sort. yray. nlev) CURV3D (xray. z) BARS3D (xray. zstp. xn. xp. n) CYLI3D (xm.

ny. nz. modifies material parameters. xr. z0. b. ypray. astp. n) QUAD3D (xm. xl. ctype) LITPOS (id. n) STRT3D (x. ctype) MATOPT (xval. plots a pyramid. r. yp) ROT3D (a. ztri. yray. zm. xb. xtri. ym. plots the surface grid of a function. zv. xg. nmax) STREAM3D (xv. iyp. turns lighting on or off. iy. ibot) SURFCE (xray. yray. a2. nx. xsray. zm. ntri) ISOPTS (xray. nx. x2. h1. xg. n. x0. plots the surface of a parametric function. wmat. initializes output of polygons to a PLY format. zp. ny. z1. disables the hidden-line algorithm. xpray. cobj) PLYINI (copt) POS3PT (x. ym. b1. h2. zray. xval. iypts) calculates isosurfaces. ypray. z. ny. zray. y2. y. zpray. y0. zp) PYRA3D (xm. selects surface colours. nz. ny. cmode) LITOP3 (id. ctype) LITOPT (id. xp. y. yp. plots a Platonic solid. nx. y1. zm. ydel) SURISO (xray. b2. yv. plots the surface of a function matrix. xdel. wlev) SURMAT (zmat. xl. sets the position of light sources. z. LABL3D (copt) LIGHT (cmode) LITMOD (id. plots isosurfaces. modifies material parameters. ny. ysray. turns single light sources on or off. plots a sphere. bstp) SURFUN (cfun. zmat) SURFCP (cfun. yray. ny. m) PLAT3D (xm. zv. modifies light parameters. wmat. nz. nx. Meaning modifies the appearance of labels on the 3-D box. 72 . ctype) MDFMAT (ix. plots a cone. r. yl. protects surfaces from overwriting. m) n = STMPTS3D (xv. copt) PLYFIN (cfil. moves the pen to a point. yray. generates a streamline. zm. ym. zray.Routine nmax. sets a face side for defining material parameters. z2. zpray. nx. xp. ytri. ixp. plots a quad. n. yv. defines rotation angles for symbols and solids. z) SURCLR (itop. ixpts. defines the colour of surface meshes. converts user coordinates to absolute 3-D coordinates. modifies the algorithm used in GETMAT. wlev. nz. xl. zl) REL3PT (x. xb. converts user coordinates to plot coordinates. xpray. xp. copt) MATOP3 (xr. a1. w) MSHCLR (iclr) MSHCRV (n) NOHIDE () PIKE3D (x1. sets the resolution of meshes for 3-D curves. nx. plots streamlines. yp. ym. plots the surface of a function matrix. modifies light parameters. c) SETFCE (copt) SHLSUR () SPHE3D (xm. xray. y. terminates output of polygons to a PLY format.

zm) THKC3D (nthk) TORUS3D (xm. copt) VTXN3D (xray. zpray. y1. ntri) SURVIS (copt) SYMB3D (n. i2ray. n. yray. determines the visible part of surfaces. nx. z2) ZBFMOD (cmod) ZBFRES () ZBFSCL (x) ZBFTRI (xray. zv. zpray. r1. y. icray. r2. ypray. xnray. nx. defines a Z-scaling for coloured surfaces. yray. zmat) SURTRI (xray. r. plots a vector field. ny. ny. zray. n. nx. n. i3ray. defines the viewpoint. ny. z1. z2. yray. plots faces from vertices. plots vectors in 3-D space. wmat) SURSHD (xray. zray. allocates space for a Z-buffer. zvray. erases the frame buffer of a Z-buffer. x2. plots the surface of an Delaunay triangulation. plots a coloured surface. yray. terminates the Z-buffer. plots a tube. ypray. copt) VUP3D (ang) ZBFERS () ZBFFIN () iret = ZBFINI () ZBFLIN (x1. zray. defines the camera orientation. plots a coloured surface. m) TUBE3D (x1. xpray. ym. ivec) VANG3D (ang) VIEW3D (x. a1. plots faces from vertices. resets the Z-buffer. y2. n. can disable the Z-buffer. zmax) Meaning enables grid lines for surfcp and surshd. a2. ynray. yray. yray. nz. n. ivec) VECMAT3D (xv. z2. yray. suppresses surface lines for surfce. zm. iray) ZSCALE (zmin. ym. Figure B. zray. defines the field of view. copt) VTXC3D (xray. y1. scales the internal image for PDF output. x2. y1. z. xm.27: 3-D Graphics 73 . xpray. i1ray. zmat. y2. plots lines. y2. x2. zray. defines the thickness of 3-D curves. m) VECF3D (xvray. n. plots a vector field on a regular grid. znray. plots triangles. yv.Routine SURMSH (copt) SUROPT (copt) SURSHC (xray. plots faces from vertices. z1. z1. yvray. n. ivec) VECTR3 (x1. h. copt) VTX3D (xray. plots a 3-D symbol. plots a torus.

plots coastlines and lakes. xstp. yor. ckey) MAPLEV (copt) MAPMOD (copt) MAPOPT (copt. x2. shades states of North and Central America. i3ray. defines map options. ipray. shades USA states. icray. ystp. cstr. n) WORLD () XAXMAP (xa. ny. nx) Figure B. x4. n) SHDSOU (inray. xor. shades states of South America. n. shades African countries. yray. shades Asiatic countries. icray. icray. yor. zray. nlev) CONGAP (xfac) CONLAB (copt) CONMAT (zmat. shades European countries. n) SHDAUS (inray. plots a geographical axis system. x5. shades Oceanic countries. ye. n) SHDMAP (copt) SHDNOR (inray. plots generated contours. selects a projection. x6) MAPLAB (copt. i1ray. yray.28: Geographical Projections B. ipray. y. specifies land or lake plotting. ye. z) CONFLL (xray. z) Meaning defines colours for shaded contours. defines two latitudes used for conical projections. modifies the connection of points used in CURVMP. plots a grid. converts user coordinates to plot coordinates. defines the base map.B. n. zlvray. defines a character string used for contour labels. n) SHDEUR (inray. n) SHDUSA (inray. n) CONCRV (xray. xor. plots a secondary Y-axis. ny) YAXMAP (ya.28 Geographical Projections Routine Meaning plots curves or symbols. CURVMP (xray. ny) MAPBAS (copt) MAPFIL (cfil. nt. icray. nt. x3. ntri. defines label options. icray. copt) MAPIMG (cfil. i2ray. ystp) GRIDMP (nx. defines an external map file. x1. yray. plots contours. xp. xstp. ipray. cstr. yp) PROJCT (copt) SHDAFR (inray. ckey) MAPPOL (xpol. ipray. plots filled contours of an Delaunay triangulation. n) SHDASI (inray. 74 . plots a secondary X-axis. xe. icray. ipray. ipray. plots a BMP or GIF map image. nx. defines the map pole used for azimuthal projections. ipray. n) GRAFMP (xa.29 Contouring Routine CONCLR (ncray. icray. yup) POS2PT (x. affects the spacing between contour lines and labels. shades continents. ya. xe. ypol) MAPREF (ylw.

ny. stores an image as a BMP file. n. terminates transfering of image data. nw. reads a pixel from memory. nx. zmat. plots contours. plots contours of an Delaunay triangulation. nmax) RBMP (cfil) RGIF (cfil) RIMAGE (cfil) RPIXEL (ix. i1ray. zlev. defines a transparency colour for images. copies an image from memory to a file. nh) IMGFIN () IMGINI () IMGMOD (cmod) IMGSIZ (nw. sets the algorithm for shaded contours. n) CONTRI (xray. generates contours. nw. defines the distance between labels. n) RTIFF (cfil) TIFORG (nx. yray.Routine CONMOD (xfac. ypts. m. i3ray. initializes transfering of image data. generates contours from triangulated data. defines a clipping window for TIFF files. ix. stores an image as a PNG file. ncrv) CONSHD (xray. xquot) CONPTS (xray. i2ray. yray. yray. ’CONT’) SHDMOD (copt. nh) . zlev) CONTUR (xray. iray. zray. nh) RPNG (cfil) RPPM (cfil) RPXROW (iray. i2ray. stores an image as a PPM file. n. ’CONT’) LABDIS (ndis. iy. ntri. ny. defines a clipping rectangle. ’CONT’) LABELS (copt. ’CONT’) TRIPTS (xray. nw. stores an image as PNG file in a buffer. ny. zmat. yray. iy. reads image data from memory. defines contour labels. maxpts. defines the position of TIFF files copied with WTIFF.29: Contouring B.30 Image Routines Routine Meaning defines a rectangle for PostScript/PDF output. i1ray. nx. plots shaded contours. zlray. zlev) LABCLR (nclr. zlev. xpts. Figure B. maxcrv. ypts. yray. zray. nw. stores an image as a TIFF file. stores an image as a GIF file. reads a row of image data from memory. nx. zmat. iclr) RPIXLS (iray. 75 IMGBOX (nx. ny. nh) IMGCLP (nx. ncrv) Meaning affects the position of contour labels. ntri. ny. n. ny) TIFWIN (nx. nh) IMGTPR (nclr) n = RBFPNG (cbuf. ny. xpts. maxpts. selects index or RGB mode. i3ray. iray. defines an image size for PostScript/PDF output. defines the colour of contour labels. maxcrv.

76 DOEVNT () ival = DWGBUT (cstr. displays a message that can be answered with ’Yes’ or ’No’. copt) id = WINID () WINKEY (ckey) WINMOD (copt) WINSIZ (nw. nw. requests the value of a box widget. nx. enables backing store. affects the handling of windows in DISFIN. defines page formats for windows. defines the position and size of windows. defines a callback routine for the windows size. ix. write a row of image data to memory. sets the title of the currently selected window. requests the value of a file widget.30: Image Routines B. ny.Routine WIMAGE (cfil) WPIXEL (ix. nyp) SELWIN (id) WINDOW (nx. writes a pixel to memory. nh) WINAPP (capp) WINCBK (crout. copies a TIFF file created by DISLIN to memory. ny. requests widget attributes.31 Window Routines Routine Meaning closes a window. iclr) WPIXLS (iray.31: Window Routines CLSWIN (id) OPNWIN (id) PAGWIN (nxp. requests the status of a button widget. cmsk) isel = DWGLIS (clab. defines a window or console application. defines a key that can be used for program continuation in DISFIN. iy. returns the ID of the currently selected window. nh) WINTIT (cstr) X11MOD (copt) B. opens a window for graphics output. n) WTIFF (cfil) Meaning copies an image from file to memory. Figure B. gets a selection from a list of items. Figure B. requests the value of a text widget as real number. creates a file selection box. defines the size of windows. displays a message. nw. writes image data to memory. returns a status for dialog widget routines. ival) iret = DWGERR () cfil = DWGFIL (clab. copt) n = GWGBOX (id) n = GWGBUT (id) cfil = GWGFIL (id) x = GWGFLT (id) .32 Widget Routines Routine Meaning processes pending events. cfil. clis. iy. isel) DWGMSG (cstr) cstr = DWGTXT (clab. prompts an user for input. nh) WPXROW (iray. cstr) n = GWGATT (id. selects a window for graphics output.

changes the status of a button widget. calculates the number of elements in a list string. returns the size of widgets. n) SWGIOP (i. isel) SWGMIX (char. ival) SWGCB (id. defines widget margins. connects a callback routine with a table widget. copt) SWGJUS (cjus. copt) SWGBOX (id. copt) SWGDRW (xf) SWGFIL (id. requests the value of a table cell as a string. sets integer options for widgets. changes the selection of a box widget. requests the value of a table cell as real number. copt) Meaning requests the value of a text widget as integer. displays a message. sets widget colours. copt) SWGSCL (id. 77 . connects a widget with a callback routine. npts) SWGFOC (id) SWGHLP (cstr) SWGINT (id. defines the size of widgets. nw. class) SWGLIS (id. crout) SWGCLR (xr. icol) n = GWBTBI (id. ndig. requests the value of a table cell as integer. defines a step value for scale widgets. ny) SWGRAY (xray. defines the height of draw widgets. extracts an element from a list string. iray) SWGCB2 (id. nh) SWGSPC (xspc. defines the position of widgets. irow. changes the value of text widgets. sets a character string for the Help menu. cmrg) SWGOPT (copt. isel) SWGBUT (id. defines the width of columns in table widgets. changes the values of table cells. copt) cstr = GWGTBS (id. ckey) SWGPOP (copt) SWGPOS (nx. modifies the spaces between widgets. icol) GWGTBL (id. j. changes the value of text widgets. requests the value of a text widget. requests the value of a list widget. idx. yspc) SWGSTP (xstp) SWGTBF (id. irow. x. catt. icol) cstr = GWGTXT (id) n = GWGXID (id) ITMCAT (clis. nh) x = GWGTBF (id. modifies the appearance of the popup menubar. routine. xb. requests the values of table cells. changes the selection of a list widget. sets widget attributes. crout) SWGCBK (id. xray. ndig) SWGFNT (cfnt. x. requests the value of a scale widget. sets a center option for parent widgets. changes the value of a file widget. n) MSGBOX (cstr) SWGATT (id. defines widget fonts. defines control characters. n. requests the windows ID of a widget. changes the value of a scale widget. n. defines the alignment of label widgets. cfil) SWGFLT (id. sets the keyboard focus. xg. connects a widget with a callback routine. i. concatenates an element to a list string. cmix) SWGMRG (ival. irow.Routine n = GWGINT (id) n = GWGLIS (id) x = GWGSCL (id) GWGSIZ (id. citem) n = ITMCNT (clis) citem = ITMSTR (clis. xval) SWGSIZ (nw.

creates a push button widget. creates a file widget. sets a title for the main widget. ny. j.Routine SWGTBI (id. creates a text widget. creates an entry in a popup menu. creates a list widget. clis. iray. uses an image as a popup menu. clab. nsize. ival) id = WGCMD (ip. cstr. terminates widget routines. nmax) id = WGTBL (ip. defines the position and size of widgets. isel) id = WGLTXT (ip. creates a OK push button widget. ix. creates a push button widget. clab. clab. A system command will be executed if the button is pressed. xmax. clab) id = WGAPPB (ip. creates a label widget. nrows. cmd) id = WGDLIS (ip. xstp) id = WGPBUT (ip. creates a button widget. copt) SWGTIT (cstr) SWGTXT (id. creates a draw widget. n. modifies the appearance of widgets. copt) SWGTBS (id. cstr) Meaning changes the values of table cells. creates a main widget and initalizes widget routines. isel) id = WGDRAW (ip) id = WGFIL (ip. creates a dropping list widget. copt) id = WGBOX (ip. nh) id = WGQUIT (ip) id = WGSCL (ip. sets the default width of widgets. xmin. clab. cfil. i. id = WGOK (ip) id = WGPBAR (ip. creates a popup menu. creates a separator widget. nw. cmsk) WGFIN () id = WGINI (copt) id = WGLAB (ip. xval. ncols) id = WGTXT (ip. changes the values of table cells. cstr. clab. x1. creates a progress bar. class) SWGVAL (id. copt) SWGTBL (id. creates a container wdiget. nh) id = WGBAS (ip. creates a Quit push button widget. cval) SWGTYP (ctype. creates a list widget with toggle buttons. nwth) id = WGPOP (ip.32: Widget Routines 78 . xray. clis. nw. i. changes the value of a text widget. idx. changes the values of table cells. creates a labeled text widget. creates a scrolled text widget. nw. xval) SWGWIN (nx. cval. Figure B. creates a table widget. cstr) id = WGPOPB (ip. nh) SWGWTH (nwth) id = WGAPP (ip. x2. iray. creates a scale widget. ndig. clis. isel) id = WGBUT (ip. changes the value of progress bars. ndez) id = WGSEP (ip) id = WGSTXT (ip. cstr) id = WGLIS (ip. j. uses an image as entry in a popup menu.

plots a coloured surface.34 MPS Logo Routine Meaning plots the MPS logo. n. m) B. n. or. n. Figure B. copt) QPLSUR (zmat. plots a curve. Figure B. plots multiple curves.33 DISLIN Quickplots Routine Meaning plots a bar graph. n) QPLSCA (xray. plots a pie chart. m.33: DISLIN Quickplots QPLBAR (xray.34: MPS Logo MPSLOGO (nx. step. yray. e. nlv) QPLCRV (xray. copt) QPLOT (xray. n) QPLCLR (zmat.B. yray. n. sets a user-defined scaling. n) QPLPIE (xray. makes a scatter plot. copt) 79 . m) QPLCON (zmat. plots a surface. nsize. makes a contour plot. n) QPLSCL (a. yray. ny. yray.

80 .

81 .Appendix C Examples This appendix presents some examples of the DISLIN manual in DISGCL coding. The examples can be found in the DISLIN subdirectory gcldir and can be executed with the command: disgcl example where example is one of the examples.

YRAY2.1 Demonstration of CURVE %GCL // Demonstration of CURVE N=101 PI = 3. 0.7.C. 1) COLOR BOX2D HEIGHT TITLE COLOR CURVE COLOR CURVE DISFIN (’FORE’) () (50) () (’RED’) (XRAY.5) SETRGB (0. ’Y’) (’Demonstration of CURVE’.1415926 XRAY XRAY YRAY1 YRAY2 = = = = FALLOC (N) (XRAY .-1.. ’X’) (’Y-axis’.) COS (XRAY * PI / 180. ’X’) METAFL DISINI COMPLX PAGERA NAME NAME TITLIN TICKS LABDIG IC = INTRGB (0..0.-1. 0..7) GRID (1.1. 0. 2) (10.6 SIN (XRAY * PI / 180..360. N) (’GREEN’) (XRAY.. ’X’) (-1.90. N) () 82 .) (’CONS’) () () () (’X-axis’..95) AXSBGD (IC) GRAF (0.) * 3..1.95.0.95. 0.7. YRAY1.

0 -0.5 Figure C. COS(X) 1.Demonstration of CURVE SIN(X).1: Demonstration of CURVE Y-axis 83 0.0 0.5 -1.0 90 180 X-axis 270 360 0 .

.30.) (’FBARS’) (x2.2.95. ’Y’) (’NOENDS’.95. ’Y’) (10./(N-1) F = STEP * 3.0. 0.) CURVE (x1. m) DISFIN () 84 .) (-5.. ’X’) (1050.0. 1000) (1050..2 Polar Plots %GCL // Polar Plots N=300 M=10 STEP = 360. ’Y’) (1000. y2. n) HTITLE (50) TITLE () ENDGRF () LABDIG AXSORG LABTYP GRAFP BARWTH POLCRV CURVE (-1. y1.C.2. 2) (3...1415926 / 180. Y1 = FALLOC (N) * F X1 = SIN (5 * Y1) X2 = FALLOC (M) + 1 Y2 = FALLOC (M) + 1 SETPAG METAFL DISINI HWFONT PAGERA TITLIN TICKS AXENDS LABDIG AXSLEN AXSORG (’DA4P’) (’CONS’) () () () (’Polar Plots’. 0. 0. 900) IC = INTRGB (0..95) AXSBGD (IC) GRAFP (1. ’X’) (-1. 2250) (’VERT’. 0..0. 30.

2: Polar Plots 85 30 0 270 24 0 .4 0.2 0.8 0 21 0 33 0 0 30 24 0 90 270 1 0 20 60 30 180 15 0 2 4 6 8 0 33 21 0 Figure C.Polar Plots 90 15 60 12 0 0 30 180 0.6 0.

1) MPAEPL (3) DISFIN () 86 .Y) = 2 * SIN(X) * SIN(Y)’.C..360.0. ’XYZ’) (’X-Achse’. N . N. ’Z’) (’3-D Colour Plot of the Function’.1 ZMAT[*. ’Y’) (’Z-Achse’.1) DO I = 0..0. 1) (’F(X.2.J] = 2 * XRAY * SIN (J * STEP) END DO METAFL DISINI COMPLX PAGERA LABDIG NAME NAME NAME TITLIN TITLIN (’CONS’) () () () (-1. N . N..1 XRAY[I] = SIN (I * STEP) END DO DO J = 0...N]. 1.3 3-D Colour Plot %GCL // 3-D Colour Plot N = 100 FLOAT ZMAT[N. 3) AUTRES (N.0.90. * PI / (N .0) TITLE () CRVMAT (ZMAT..-2. XRAY[N] PI = 3. N) GRAF3 (0.1415927 STEP = 2..1.-2..360...90. ’X’) (’Y-Achse’..

3: 3-D Colour Plot Y-axis 87 Z-axis 180 0 90 -1 0 90 180 X-axis 270 360 -2 0 .3-D colour plot of the function F(X.Y) = 2 * SIN(X) * SIN(Y) 2 360 270 1 Figure C.

1) DISFIN () 88 ..1 ZMAT[*..0.N]. N .3.Y) = 2 * SIN(X) * SIN(Y)’.-3. ’Z’) TITLIN (’Surface Plot (SURMAT)’.-5..0...-3.. * PI / (N .1) DO I = 0...1 XRAY[I] = SIN (I * STEP) END DO DO J = 0. 2) TITLIN (’F(X.0.J] = 2 * XRAY * SIN (J * STEP) END DO METAFL SETPAG DISINI COMPLX PAGERA (’CONS’) (’DA4P’) () () () AXSPOS (200.. N.’ABS’) (0.90.C... ’Y’) (’Z-axis’. N.1.. XRAY[N] PI = 3.. ’X’) (’Y-axis’. 1800) NAME NAME NAME (’X-axis’.360.) (50) () COLOR (’GREEN’) SHLSUR () SURMAT (ZMAT. N .90.4 Surface Plot %GCL // Surface Plot N = 100 FLOAT ZMAT[N.4. 1.. 2600) AXSLEN (1800.1415927 STEP = 2. 4) VIEW3D GRAF3D HEIGHT TITLE (-5.360.

Y) = 2*SIN(X)*SIN(Y) Figure C.Surface plot (SURMAT) F(X.4: Surface Plot 89 .

1 ZMAT[*.90...360. ’CONTUR’) END IF CONTUR (X.1) * 0.0...90.0. ZLEV) END DO HEIGHT (50) TITLE () DISFIN () 90 . Y.) HEIGHT (30) DO I = 1.Y) = 2 * SIN(X) * SIN(Y)’. ’Y’) (’Contour Plot’. N. 2670) NAME NAME TITLIN TITLIN (’X-axis’.N]..5 IF (I == 5) LABELS (’NONE’. 2) (’F(X. XRAY[N] FPI = 3.5 Contour Plot %GCL // Contour Plot N = 100 FLOAT ZMAT[N.1) X = FALLOC (N) * STEP Y = FALLOC (N) * STEP DO J = 0.. ’X’) (’Y-axis’. ’CONTUR’) ELSE LABELS (’FLOAT’. N. N ..9 ZLEV = -2.360.1415927 / 180. / (N .C.0.0 + (I . STEP = 360. 4) GRAF (0. ZMAT.J] = 2 * SIN (X * FPI) * SIN (Y[J] * FPI) END DO METAFL SETPAG DISINI COMPLX PAGERA (’CONS’) (’DA4P’) () () () INTAX () AXSPOS (450.

5 180 -0 0.5 -1.Contour Plot F(X.5 -1 .0 -1.0 -0.0 0.0 0.0 -1 .Y) = 2 * SIN(X) * SIN(Y) 360 -0.5 90 1.5 270 1.5 .5 .0 -1 0.5 1.5 -1.5 1.0 1 .0 1.5 -1.5 -0.5 0.5 0.5 -1.5 -1.5 1.5 1.0 0. 5 .5: Contour Plot 91 -0 .5 -0.0 Y-axis 0.5 0 0 90 180 X-axis 270 360 Figure C. 0 -1. 0 1 . 5 1.

N]. N..C. XRAY[N]. 1) TITLIN (’F(X. 3) SHDMOD (’POLY’. N . N.1.. YRAY. 1.6. ZLEV. ’Y’) MIXALF () TITLIN (’Shaded Contour Plot’. 2670) GRAF (0.2) HEIGHT (30) DO I = 0.1 + I * 0. ZLEV[12] STEP XRAY YRAY X = = = = 1.Y) = (X[2$ . 0. 11 ZLEV[11-I] = 0.6 / (N . ZMAT. ’X’) (’Y-axis’. 0. ZMAT[*.6.J] = X * X + Y * Y END DO METAFL SETPAG DISINI COMPLX PAGERA NAME NAME (’CONS’) (’DA4P’) () () () (’X-axis’.2. 0.1)[2$ + (y[2$ . 0..1)[2$’.1 END DO CONSHD (XRAY.6 Shaded Contour Plot %GCL // Shaded Contour Plot N = 100 FLOAT ZMAT[N.1 Y=YRAY[J] * YRAY[J] . ’CONTUR’) AXSPOS (450. 1. 0.1) FALLOC (N) * STEP FALLOC (N) * STEP XRAY * XRAY .. YRAY[N]. 12) HEIGHT (50) TITLE () DISFIN () 92 .1 DO J = 0.

6 0.8 0.6 0.4 0.6: Shaded Contour Plot 93 .4 1.0 0.2 1.2 1.2 0.0 1.Shaded Contour Plot F(X.0 0.4 0.1) 2 + (Y 2 .Y) = (X 2 .6 1.4 1.6 Figure C.2 0.8 X-axis 1.0 Y-axis 0.1) 2 1.

-90.90..) GRIDMP COLOR WORLD COLOR (1.. 3) LABELS (’MAP’. 1400) NAME (’Longitude’..30..-180.7 World Coastlines and Lakes %GCL // World Coastlines and Lakes METAFL DISINI PAGERA COMPLX (’CONS’) () () () AXSPOS (400. ’X’) NAME (’Latitude’..-90.180. 1) (’GREEN’) () (’FORE’) HEIGHT (50) TITLE () DISFIN () 94 . ’X’) TITLIN (’World Coastlines and Lakes’. ’XY’) GRAFMP (-180.C...90. 1850) AXSLEN (2400.

0 o Longitude 90.0 o W 0.0 o 30.0 o N Latitude Figure C.0 o E .0 o S 60.0 o W 90.0 o N 60.7: World Coastlines and Lakes 95 0.0 o S 180.0 o S 90.World coastlines and lakes 90.0 o N 30.0 o E 180.

ID_LAB. ’ ’. CL1. ID_FIL. ’*.c’) ID_LAB = WGLAB (IP. ’This is Button 2’.C. 1) ID_OK = WGOK WGFIN () CFIL ILIS IBT1 IBT2 XSCL = = = = = GWGFIL GWGLIS GWGBUT GWGBUT GWGSCL (IP) (ID_FIL) (ID_LIS) (ID_BT1) (ID_BT2) (ID_SCL) FREE IP. ’Open File’. ID_OK. ’This is Button 1’. ’Scale Widget’) ID_SCL = WGSCL (IP. CL1. 0. 0) ID_BT2 = WGBUT (IP. 1) ID_LAB = WGLAB (IP... ID_BT1 @ ID_BT2.. ID_LIS. ’File Widget: ’) ID_FIL = WGFIL (IP. CFIL. 1) ID_LAB = WGLAB (IP. 10. ’Button Widgets’) ID_BT1 = WGBUT (IP. 5. ’List Widget: ’) ID_LIS = WGLIS (IP. ID_SCL LIST 96 .8 Widgets %GCL // Widgets CL1 = ’Item1|Item2|Item3|Item4|Item5’ CFIL = ’ ’ SWGTIT (’Example’) IP = WGINI (’VERT’) ID_LAB = WGLAB (IP.

Figure C.8: Widgets

97

98

Index

99

11 EXTERN statement 24 FALLOC function 50 FCLOSE function 41 FFLUSH function 42 FGETC function 43 FGETS function 43 100 .ABS function 47 ACOS function 47 ARG function 48 ARGCNT function 49 Arrays 8 character 9 functions 49 initializing 17 multidimensional 9 operations 12 ASIN function 47 ATAN function 47 ATAN2 function 47 ATONUM function 48 BREAK statement 19 BYTE command 22 BYTE function 48 CATARR function 49 CEIL function 47 CHAR command 22 CHAR function 48 CLOCK function 53 Comments 15 COMPLEX command 22 Complex functions 48 COMPLEX function 48 CONJG function 48 Constants 8 numbers 8 hexadecimal 8 integers 8 strings 8 CONTINUE statement 20 Conversing functions 48 COS function 47 COSH function 47 DALLOC function 50 Data files 33 Data types 7 DATBLK function 34 DATCLS function 34 DATCNT function 34 DATE function 53 DATFIL function 33 DATHDR function 34 DATMAT function 34 DATRAY function 34 DATVAR function 34 DISGCL commands 16. 21 BYTE 22 CHAR 22 COMPLEX 22 CONTOUR 29 CONSHADE 29 DOUBLE 22 EXIT 21 FLOAT 22 FREE 22 HELP 21 INCLUDE 21 INT 22 LIST 21 LOGOFF 22 LOGON 22 PLOT3R 28 PLOT3 28 PLOT 27 PRINT 22 SCATTR 28 SHORT 22 SURF3 28 SURFACE 28 SURSHADE 28 DISGCL script files 2 DISGCL statements 2 DISLIN functions 16 DISLIN subroutines 15 DO statement 18 DOUBLE command 22 DOUBLE function 48 Examples 75 3-D Colour Plot 80 Contour Plot 88 Data files 35 Demonstration of CURVE 76 Format specifications 38 Input/output 45 Polar Plots 78 Shaded Contour Plot 84 Surface Plot 82 Widgets 90 World Coastlines and Lakes 88 EXIT command 21 EXP function 47 Expressions 4.

48 EXP 47 FALLOC 50 FCLOSE 41 FFLUSH 42 FGETC 43 FGETS 43 FLOAT 14. 50 CATARR 47 CEIL 47 CHAR 14. 48 COSH 47 COS 47 DALLOC 50 DATBLK 34 DATCNT 34 DATE 53 DATFIL 33 DATHDR 34 DATMAT 34 DATRAY 34 DATVAR 34 DOUBLE 14.File modes 41 FLOAT command 22 FLOAT function 48 FLOOR function 47 FMOD function 47 FOPEN function 41 Format specifications 37 FPRINTF function 43 FPUTC function 44 FPUTS function 44 FREAD function 44 FREE command 22 FSCANF function 43 FSEEK function 42 FTELL function 42 FUNCTION statement 24 Function 49 ABS 47 ACOS 47 ARGCNT 49 ASIN 47 ATAN2 47 ATAN 47 ATONUM 48 BYTE 14. 48 FLOOR 47 FMOD 47 FOPEN 41 101 FPRINTF 43 FPUTC 44 FPUTS 44 FREAD 44 FSCANF 43 FSEEK 42 FTELL 42 FWRITE 45 GETARG 1 GETENV 53 GETPID 53 GETS 44 IALLOC 50 INT 14. 48 SINH 47 SIN 47 SPRINTF 39 SQRT 47 SRAND 53 SSCANF 40 STRING 14. 48 KEYCNT 49 LOG10 47 LOG 47 MAXARR 49 MINARR 49 NUMTOA 48 PRINTF 37 PUTS 44 RAND 53 REMOVE 41 RENAME 42 REWIND 42 SCANF 40 SHORT 14. 48 STRLEN 51 STRLWR 51 STRREP 51 STRSTR 51 STRUPR 51 SUBARR 49 SUBMAT 49 SUBSTR 51 SYSTEM 53 TANH 47 TAN 47 TIME 53 TRMLEN 51 TRPMAT 49 user-defined 23 VARCNT 49 VARDEF 49 . 48 CLOCK 53 COMPLEX 14.

27 CONTOUR 29 CONSHADE 29 PLOT3R 28 PLOT3 28 PLOT 27 scaling 29 SCATTR 27 SURF3 28 SCANF function 40 SCATTR command 27 SHORT command 22 SHORT function 48 SIN function 47 SINH function 47 SPRINTF function 39 SQRT function 47 SSCANF function 40 Statements 2 BREAK 19 calling DISLIN routines 15 comments 15 CONTINUE 20 DO 18 EXTERN 24 FUNCTION 24 GOTO 20 identification of GCL files 15 IF 17 IF constructs 17 RETURN 24 SUBROUTINE 24 SWITCH 18 WHILE 19 STRING function 48 String functions 51 Strings 9 STRLEN function 51 STRLWR function 51 STRREP function 51 STRSTR function 51 STRUPR function 51 SUBARR function 49 SUBMAT function 49 SUBROUTINE statement 24 Subroutines user-defined 23 SUBSTR function 51 SURF3 command 28 SWITCH statement 18 Syntax of data files 33 Syntax of GCL script files 2 Syntax of GCL statements 2 102 .VARDIM 49 VARTYP 49 FWRITE function 45 GETARG function 1 GETENV function 53 GETPID function 53 GETS function 44 GOTO statement 20 HELP command 21 SURFACE 28 SURSHADE 28 variables 30 Random number functions REMOVE function 41 RENAME function 42 RETURN statement 24 REWIND function 42 53 IALLOC function 50 IF constructs 17 IF statement 17 IMAG function 48 INCLUDE command 21 INT command 22 INT function 48 Intrinsic functions 47 KEYCNT function 49 LIST command 21 LOG function 47 LOG10 function 47 LOGOFF command 22 LOGON command 22 Mathematical functions 47 MAXARR function 49 Memory allocating functions MINARR function 49 NUMTOA function Operators 11 48 50 Parameters 25 PLOT command 27 PLOT3 command 28 PLOT3R command 28 PRINT command 22 PRINTF function 37 PUTS function 44 Quickplot 4.

Syntax of the GCL command System commands 20 System functions 53 SYSTEM function 53 System variables 8 %ARGn 1 %CONSHD 31 %ERASE 27 %HNAME 30 %HSYMBL 30 %HTITLE 30 %H 30 %INCMRK 30 %MARKER 30 %NARGS 1 %POLCRV 30 %T1 30 %T2 30 %T3 30 %T4 30 %VTITLE 31 %X 30 %X3LEN 31 %X3VIEW 31 %XDIG 30 %XLAB 30 %XLEN 30 %XMAX 29 %XMIN 29 %XOR 29 %XPOS 30 %XRES 30 %XSCL 30 %XSTEP 29 %XTIC 30 %Y 30 %Y3LEN 31 %Y3VIEW 31 %YDIG 30 %YLAB 30 %YLEN 30 %YMAX 29 %YMIN 29 %YOR 29 %YPOS 30 %YRES 30 %YSCL 30 %YSTEP 29 %YTIC 30 %Z 30 %Z3LEN 31 %Z3VIEW 31 1 %ZDIG 30 %ZLAB 30 %ZLEN 30 %ZMAX 29 %ZMIN 29 %ZOR 29 %ZSCL 30 %ZSTEP 29 %ZTIC 30 TAN function 47 TANH function 47 Time functions 53 TIME function 53 TRMLEN function 51 TRPMAT function 49 Type conversions 12 VARCNT function VARDEF function VARDIM function Variables 7 VARTYP function WHILE statement 49 49 49 49 19 103 .

104 .