The size of the page is determined by the routines SETPAG and PAGE. SETPAG corresponds to a predefined page while PAGE defines a global page setting. In default mode, there are 100 points per centimeter and the point (0,0) is located in the upper left corner (Figure 2.1):
(0,0) +----------------------------------+
| |
| |
| |
| DIN A 4 Landscape |
| |
| |
| |
+----------------------------------+ (2969,2099)
Figure 2.1 : Default Page (DA4L)
The file formats are:
0 before initialization or after termination
1 after initialization or a call to ENDGRF
2 after a call to GRAF
3 after a call to GRAF3 or GRAF3D.
Generally, programs should have the following structure:
(1) setting of page format, file format and filename
(2) initialization
(3) setting of plot parameters
(4) plotting of the axis system
(5) plotting the title
(6) plotting data points
(7) termination.
Though it is possible to call C routines in Fortran programs and Fortran subroutines in C programs, it is easier to use the corresponding library. Especially, the passing of strings can be complicate in mixed language programming.
The number and meaning of parameters passed to DISLIN routines are identical for all libraries. The Fortran version uses INTEGER, REAL and CHARACTER variables while the C library uses int, float and char variables. A detailed description of the syntax of C routines is given by the utility program DISHLP or can be found in the header file 'dislin.h' which must be included in all C programs.
Here is a short example for a DISLIN C programm:
#include
#include "dislin.h"
main()
{
disini ();
messag ("This is a test", 100, 100);
disfin ();
}
An example for a DISLIN C++ programm is:
#include
namespace dislin {
#include "dislin.h"
}
main()
{
dislin::disini ();
dislin::messag ("This is a test", 100, 100);
dislin::disfin ();
}
Important:
PROGRAM TEST
USE DISLIN
CALL DISINI ()
CALL MESSAG ('This is a test', 100, 100)
CALL DISFIN ()
END PROGRAM TEST
| Command: | DLINK | [option] | main |
| option | is an optional parameter containing a minus sign and a character. The following options can be used on all computers: |
| -c | for compiling programs before linking. |
| -cpp | for compiling a C++ program before linking. |
| -r | for running programs after linking. |
| -a | for compiling, linking and running programs. |
| -r8 | for using the double precision libraries of DISLIN. |
| main | is the name of the main program. |
Notes:
D I S H L P
DISHLP prints the description of a DISLIN routine on the screen.
| Command: | DISHLP | routine | [options] |
| routine | is the name of a DISLIN routine or a question mark. For a question mark, all routine names will be listed. An empty input terminates the program. |
| options | is an optional field of keywords (see DISHLP). |
D I S M A N
DISMAN prints an ASCII version of the DISLIN manual on the screen.
| Command: | DISMAN | [options] |
| options | is an optional field of keywords (see DISMAN). |
D I S D R V
DISDRV sends a plotfile to a device. CGM and GKSLIN files can be used for all devices while device-dependent plotfiles can only be sent to corresponding devices.
| Command: | DISDRV | filename[.MET] | [device] | [options] |
| filename | is the name of a plotfile. |
| device | is the name of a device. CONS refers to the graphics screen and XWIN to a smaller graphics window. |
| options | is an optional field of keywords (see DISDRV). |
D I S I M G
DISIMG displays an image file on the screen, or converts it to PostScript and TIFF.
| Command: | DISIMG | filename[.IMG] | [device] | [options] |
| filename | is the name of the image file. The file must be created with the routine RIMAGE. |
| device | is the name of a device. CONS refers to the graphics screen and XWIN to a smaller graphics window. |
| options | is an optional field of keywords (see DISIMG). |
D I S M O V
DISMOV displays a sequence of image files.
| Command: | DISMOV | filename[.MOV] | [device] | [options] |
| filename | is the name of a data file where the filenames of the images are stored (1 line for each filename). The images must be created with the routine RIMAGE. |
| device | is the name of a device. |
| options | is an optional field of keywords (see DISMOV). |
D I S G I F
DISGIF displays a GIF file on the screen, or converts it to another format.
| Command: | DISGIF | filename[.GIF] | [device] | [options] |
| filename | is the name of the GIF file. |
| device | is the device name. |
| options | is an optional field of keywords (see DISGIF). |
D I S T I F
DISTIF displays a TIFF file created by DISLIN on the screen, or converts it to PostScript and an image format.
| Command: | DISTIF | filename[.TIF] | [device] | [options] |
| filename | is the name of the TIFF file. The file must be created with the routine RTIFF. |
| device | is the device name. |
| options | is an optional field of keywords (see DISTIF). |
D I S A P S
DISAPS converts an ASCII file to a PostScript file.
| Command: | DISAPS | filename | [output] | [options] |
| filename | is the name of the ASCII file. |
| output | is the name of the output file. By default, the name of the input file and the extension ps will be used. |
| options | is an optional field of keywords (see DISAPS). |
Additional note:
DISGCL is an interpreter for DISLIN. All DISLIN statements can be written to a script file and then be executed with DISGCL, or can be entered in an interactive mode. High-level language elements such variables, operators, expressions, array operations, loops and user-defined functions van be used within DISGCL.
| Command: | DISGCL | filename[.GCL] | [args] | [options] |
| filename | is the name of a DISGCL script file. The extension '.gcl' is optional. |
| args | are optional arguments that can be passed to DISGCL scripts (see DISGCL). |
| options | is an optional field of keywords (see DISGCL). |
Helmut Michels Max-Planck-Institut fuer Sonnensystemforschung, Max-Planck-Str. 2, D-37191 Katlenburg-Lindau, Germany E-Mail: michels@mps.mpg.de Tel.: +49 5556 979 334 Fax: +49 5556 979 240