3 The KASDEF commands
3.1 Preface
The term KASDEF has historical reasons (german \Kastende nition", i.e. de nition of the box).
KASDEF commands start with the word KASDEF. It's more modern to use the Backslash (n) instead
(both are valid, though). Error messages (and partly this manual) still use the old naming
KASDEF.
KASDEF commands may have continuation lines. They start with
n>
and work as if the previous line's KASDEF command were continued behind the > character.
(Nearly) all KASDEF commands that have a parameter with the meaning in units may have these
replaced by prede ned constants XMIN, XMAX, YMIN, YMAX and PXMIN etc., where XMIN
etc. are the coordinates of the BoundingBox and PXMIN etc. are those of the page. This option is
however partly obsolete and should not be used anymore. It's more convenient to use (proper variables
instead (see below).
KASDEF commands may contain variables which are replaced by their current content during the
program execution. Variables (see Ch. 3.3.2) are marked by a preceding dollar sign ($, like in Unix). In
principal they are Strings, but one can also calculate with them if their contents are numbers (see, e.g.,
nCALC). The command nPREDEFINE-VARIABLES (see page 23) creates a whole set of standard
variables, e.g. $XMIN.
Note that variable names are re|laced by their conten nearly everywhere. When printing
text, each $ is interpreted as the beginning of a variable and the program tries to replace
it. In case a dollar sign shall be printed, it needs to be escaped by n$ (also see Table 1).
Exception: As long as a plot has no variables de ned, the substitution of variables is switched
o .
Furthermore, in many cases it's possible (try!) to use the code word SAME in place of repeated
parameters, e.g.:
nSYM 3. 4. 0. 0. 1. 4
nSYM SAME SAME 0. 0. 1. 8
plots a square and a circle centered at the same coordinates.
In many KASDEF commands, parameters may be speci ed to be taken logarithmically, or to be raised to
a power of ten. For example, one can write LOG35000 (without blank!) for log(35000) and
DEX5. for 105:. Arithmetic expressions instead of parameters are not yet possible but planned
for future versions of the program (so far one has to use the CALC command to prepare
parameters).
3.1.1 Three types of KASDEF commands
The execution of WRplot is split into three phases:
- Reading the input le
- Manipulation of data (only in the Interactive mode)
- Printing the plot
WRplot has three types of KASDEF commands:
-
Settings
- are interpreted during the read-in phase of the WRplot le. They set certain
speci cations for the plot which cannot be changed later. The nINCLUDE command, which
inserts the KASDEFS from an external le, belongs to the Settings, too.
-
Instructions
- are KASDEF commands that do not perform plotting actions, but, e.g., deal with
variables. Instructions can be arranged inside INSTRUCTION EXPORT blocks; such blocks
are already executed during the read-in phase of the plot le. Any KASDEF commands
outside such blocks are rst stored in a bu er and executed later during the phase when
the plot is created.
-
Plot commands
- create the output of text and graphics or relate to such actions (e.g. de nition of
the current color by nCOLOR). As Plot commands are not executed in the read-in phase,
and are therefore not allowed inside an INSTRUCTION EXPORT block.
Because some old WRplot scripts may violate this strict rule, WRplot enters a compatibility
mode if a Plot command is found inside an INSTRUCTION EXPORT block. In this case, all
commands of the INSTRUCTION EXPORT block are executed a second time during the
Plot phase. A WARNING is issued, because this might cause spurious e ects.
Settings and Instructions may only appear in the preamble, e.g. before the block that describes the box
(starting with HEADER). Plot commands may in contrast also appear further below, i.e. between the
data blocks.
3.2 Settings
KASDEF commands of this type are read rst, as they pre-specify certain values which cannot be
modi ed later anymore. These commands must appear before the HEADER line (otherwise they are
ignored and produce a non-fatal error message).
-
nINTERACTIVE
-
enters the interactive mode; the same mode can be reached by the interactive menues,
when calling wrplot without lename. Clearly, it only works with the X11 window (i.e. not
when a PostScript le shall be produced).
The INTERACTIVE mode o ers many possibilities, especially by means of graphic input with the
mouse, for instance:
- zooming into the data;
- measuring equivalent widths;
- rectifying spectra.
The menus are self-explaining, please gure out yourself.
-
nPENDEF
- <pen: integer>
De nes the default value of the line thickness for datasets (in units of typographic points,
i.e. 1/72 inch).
-
nDEFAULTCOLOUR
- : integer>
De nes the default color of the datasets. If not speci ed, it is 1 (black).
-
nOFS
- <xoffset: cm> <yoffset: cm>
Sets the o set of the lower left corner of the plot box relative to the corner of the page. The default
is (4., 3.). This option is especially needed to arrange multiple plots on a single page
(MULTIPLOT).
-
nSKL
- <Scale factor f : real>
Scales the following plot by the given scale factor f . The default is 1. This is often needed to
arrange multiple plots on a single page.
-
nINBOX
-
Datasets are clipped to the inside of the box. Graphical objects plotted by KASDEF commands are
not subject to this clipping, unless the corresponding KASDEF command stands after a PAUSE
command and is hence plotted after the datasets. Filled areas which are partly clipped might
su er from spurious e ects.
-
nNOBOX
-
The plot box (including tick marks and their labels) are suppressed. The header (plot caption) and
axes descriptions are not a ected.
-
nLATEBOX
-
The data box (including tick marks etc.) are plotted after the datasets, i.e. can overplots other
objects.
-
nDEFAULTS
-
de nes a coordinate system with scales of 1 cm per unit in both axes. The origin is at the lower left
corner of the page (i.e. it implies nOSF 0 0), and the axes are not shown (i.e. it implies NOBOX).
This DEFAULTS setting is mutually exclusive with the de nition of the coordinate box as decribed
in Sect. 5.
-
nLETTERSIZE
- <size r: real>
Size of the characters for labels of the plot box (tick labels, axes descriptions, plot caption).
Default: 0.4
-
nTICKSIZE
- <size r: real>
Size of the (small) ticks at the plot box (the numbered ones have the double length); by default
their size is harmonic to the LETTERSIZE (same numerical value).
-
nSET_NDATMAX
- <n.points n: integer>
Changes the maximum number of data pairs in a dataset. The default is NDATMAX = 100000. The
maximum value allowed is 10 times this default. Increasing NDATMAX leads to a corresponding
decrease of the maximum number of datasets, NSETMAX.
-
nSET_NSETMAX
- <n.sets n: integer>
Change the maximum number of datasets. The default is NSETMAX = 100. The maximum value
allowed is 10 times the default. Increasing NSETMAX leads to a corresponding decrease of the
maximum number of data pairs in a dataset, NDATMAX, such that NSETMAX