Autograph, A Package of Routines to Draw X/Y Plots
David J. Kennison
NCAR, P.O. Box 3000, Boulder, Colorado 80307-3000
email: kennison@ucar.edu
Table of Contents
INTRODUCTION
OVERVIEW
ROUTINES
EZY (YDRA,NPTS,GLAB)
EZXY (XDRA,YDRA,NPTS,GLAB)
EZMY (YDRA,IDXY,MANY,NPTS,GLAB)
EZMXY (XDRA,YDRA,IDXY,MANY,NPTS,GLAB)
ANOTAT (XLAB,YLAB,LBAC,LSET,NDSH,DSHC)
DISPLA (LFRA,LROW,LTYP)
AGSETP (TPGN,FURA,LURA)
AGSETF (TPGN,FUSR) or AGSETR (TPGN,FUSR)
AGSETI (TPGN,IUSR)
AGSETC (TPGN,CUSR)
AGGETP (TPGN,FURA,LURA)
AGGETF (TPGN,FUSR) or AGGETR (TPGN,FUSR)
AGGETI (TPGN,IUSR)
AGGETC (TPGN,CUSR)
AGSTUP (XDRA,NVIX,IIVX,NEVX,IIEX, . . . )
AGBACK
AGCURV (XVEC,IIEX,YVEC,IIEY,NEXY,KDSH)
AGSAVE (IFNO)
AGRSTR (IFNO)
AGBNCH (IDSH)
AGDSHN (IDSH)
AGUTOL (IAXS,FUNS,IDMA,VINP,VOTP)
AGCHAX (IFLG,IAXS,IPRT,VILS)
AGCHCU (IFLG,KDSH)
AGCHIL (IFLG,LBNM,LNNO)
AGCHNL (IAXS,VILS,CHRM,MCIM,NCIM, . . . )
AGPWRT (XPOS,YPOS,CHRS,NCHS,ISIZ,IORI,ICEN)
PARAMETERS
EXAMPLES
MESSAGES
This is the unabridged write-up of AUTOGRAPH: a graphics package enabling
the user to draw graphs, each with a labelled background and each displaying
one or more curves.
This write-up is divided into several major sections: The section
"OVERVIEW" presents the philosophy of the package
and should eventually be read by a serious user. The section
"ROUTINES" describes the various routines in the
package and how to call them. The section
"PARAMETERS" describes the "control parameters"
which govern the behavior of AUTOGRAPH. The section
"EXAMPLES" explains how to get a set of graphs
produced by AUTOGRAPH and the programs which produced them. The section
"MESSAGES" describes messages that accompany the
possible error exits.
Each major section is divided into titled paragraphs, which are further
divided into untitled paragraphs. In general, phrases like "the preceding
paragraph" or "the following paragraph" are to be interpreted to refer to
a titled paragraph.
Readers who wish only to quickly draw a simple graph may want to skip to
the descriptions of the routines EZY, EZXY, EZMY, and EZMXY, in the section
"ROUTINES". Others may wish to look first at the
examples.
This section describes the philosophy of AUTOGRAPH.
To draw a graph, a user program executes, directly or indirectly, a series
of calls to AUTOGRAPH routines, typically as follows:
- The routines AGSETC, AGSETF, AGSETI, AGSETP, and/or AGSETR are called
to reset "primary control parameters" having unsatisfactory values.
- The routine AGSTUP is called to perform "set-up" tasks (hence the name).
It computes appropriate values for the "secondary control parameters".
- The routine AGBACK is called to draw a background.
- The routine AGCURV is called one or more times (once per curve) to draw
the desired curves.
- The system-plot-package routine FRAME is called to advance to a new
frame.
To draw the next graph, all five steps are repeated; step 1 may be
abbreviated or omitted entirely.
Each of the routines EZY, EZXY, EZMY, and EZMXY performs a sequence of
calls like that described above. A user program may call
- EZY to graph a single curve defined by the points (I,Y(I)), for I
from 1 to N,
- EZXY to graph a single curve defined by the points (X(I),Y(I)), for
I from 1 to N,
- EZMY to graph the M curves defined by the points (I,Y(I,J)), for I
from 1 to N and J from 1 to M, and
- EZMXY to graph the M curves defined by the points (X(I),Y(I,J)) or
(X(I,J),Y(I,J)), for I from 1 to N and J from 1 to M.
See the descriptions of these routines, in the section
"ROUTINES". See also examples from
"agex01" through "agex04".
The labeled common block AGCONP contains the AUTOGRAPH "control
parameters", each of which controls some aspect of the package's
behavior. There are two types of these: "primary control parameters"
and "secondary control parameters".
- Each primary control parameter has a default value and is subject to
change by a user program to produce a desired effect.
- Each secondary control parameter is computed by AUTOGRAPH itself and
is not normally subject to direct change by a user program. The values
computed for some of the secondary control parameters may be of
interest and may be retrieved by a user program.
Access to the control parameters is provided by the routines AGGETC,
AGGETF, AGGETI, AGGETP, AGGETR, AGSETC, AGSETF, AGSETI, AGSETP, and AGSETR.
(The routines ANOTAT and DISPLA provide access to a limited subset of the
control parameters and are provided principally for historical reasons;
they are of interest mainly to users of the routines EZY, EZXY, EZMY, and
EZMXY.)
In the rest of this document, the long phrase "primary control parameter"
will usually be shortened to just "parameter".
There are many groups of parameters. Each group has a keyword associated
with it - like BACKGROUND or GRAPH or AXIS. Those groups which contain
more than one parameter are divided into subgroups, each of which also
has a keyword associated with it. The subgroups may be further subdivided
in the same manner.
Group keywords are used to make up names of parameter groups and,
ultimately, of individual parameters. This is done by stringing together
the group keywords, in descending order, separated by slashes and
terminated by a period. For example, the name 'AXIS.' refers to a group
of 92 parameters describing the four axes, the name 'AXIS/LEFT.' to a
subgroup of 23 parameters describing the left axis, the name
'AXIS/LEFT/NUMERIC.' to a further subgroup of 8 parameters describing
the numeric labels on the left axis, and the name 'AXIS/LEFT/NUMERIC/TYPE.'
to a single parameter describing the type of numeric labels on the left
axis.
Parameter-group names are used as arguments in calls to parameter-access
routines to identify the parameter(s) whose values a user program wishes
to "set" or "get". For example, the statement
CALL AGSETR ('AXIS/LEFT/NUMERIC/TYPE.',1.)
is used to set the value of the parameter specifying the type of numeric
labels to be used on the left axis to "1.".
Parameter-group names may be shortened considerably, both by abbreviation
of the keywords and by omission of some keywords; for example, the name
shown above may be shortened to 'LE/TY.'.
Complete information about the control parameters and their names is given
below, in the section "PARAMETERS".
All of the control parameters are of type REAL - even those which serve
as type specifiers, control flags, item counts, list pointers, and the
like - for which integer variables would normally be used. This was done
because of a portability problem which arose in implementing the
parameter-access routines.
Those parameters which may only have discrete integral values are
referenced internally using the FORTRAN function IFIX. For example: The
parameter 'X/NICE.' corresponds to a variable in the common block AGCONP
named QCEX, which may have any of the values "-1.", "0.", or "+1.". The
function IFIX(QCEX) is used by AUTOGRAPH to recover the integer value.
Conceptually, some parameters have character-string values; for example,
the parameter 'DASH/PATTERN/1.' may, conceptually, have the value
'$$$$$1$$$$$'. Obviously, one must come up with a scheme which will
allow any possible character string to be represented as a real number.
At one time, the real equivalent of the memory address of the character
string was used as the actual value of the parameter. This approach led
to portability problems and has been abandoned in favor of the following:
A character string which is to become the conceptual value of a parameter
is stashed in a character-string array inside AUTOGRAPH and a real
identifier which will enable later retrieval of the string is stored
as the actual value of the parameter. (As it happens, such identifiers
are always negative; positive values may therefore have other uses. For
example, if 'DASH/PATTERN/1.' has a negative value, a character-string
dash pattern is implied, but, if it has a positive value, a 16-bit binary
dash pattern is implied.)
The routine AGSETP (AGGETP) is called by a user program to "set" ("get")
the real values of a group of related parameters.
The routine AGSETR is used to store a real number as the value of a single
parameter and the routine AGGETR is used to retrieve the real value of a
single parameter. (For historical reasons, equivalent routines AGSETF and
AGGETF are provided, as well.)
The routine AGSETI is used to store the real equivalent of an integer as
the value of a single parameter and the routine AGGETI is used to retrieve
the integer equivalent of the value of a single parameter.
The routine AGSETC is used to store a character string as the (conceptual)
value of a single parameter and the routine AGGETC is used to retrieve
the (conceptual) character-string value of a single parameter.
Setting certain individual parameters results, as a side effect, in
"special action" by the routine AGSETP. For example, when 'BACKGROUND.'
is given a new value, other parameters are also changed to create the
desired background. These side effects occur whether AGSETP is reached
directly from the user program or indirectly, by way of a call to one
of the routines AGSETC, AGSETF, AGSETI, or AGSETR. They do not occur
when AGSETP is asked to set one of the parameters in question as part
of a multi-parameter group, only when it is asked to set that parameter
individually.
Parameters whose values have been changed by the user do not automatically
revert to their default values. Re-creating the default state of AUTOGRAPH
by resetting individual parameters can become quite tedious. The routines
AGSAVE, which saves the current state of AUTOGRAPH in a file, and AGRSTR,
which restores a saved state of AUTOGRAPH from a file, should be used
instead. These routines are described in the section
"ROUTINES".
The parameters 'NULL/1.' and 'NULL/2.' define the special values "null 1"
and "null 2", which have the default values "1.E36" and "2.E36",
respectively. These special values are used in a couple of ways:
- Certain parameters may be given an "actual" value or one of the "null"
values. An actual value directly expresses the value of some quantity.
The value "null 1" specifies that AUTOGRAPH is to choose an appropriate
value to use, but that it is not to store that value in place of the
"null 1". The value "null 2" specifies that AUTOGRAPH is to choose an
appropriate actual value and store that actual value in place of the
"null 2".
- Example: 'Y/MINIMUM.', which specifies the minimum Y coordinate,
has the default value "null 1", specifying that, for each graph,
AUTOGRAPH is to choose (by examining the data) an appropriate minimum
Y. This parameter may be given an actual (non-null) value, thus
imposing a desired minimum Y, or it may be given the value "null 2",
specifying that AUTOGRAPH is to choose an appropriate minimum Y for
the next graph and then use that value for following graphs.
- The value "null 1" is used in X/Y coordinate data to signal missing
points.
Note: Because of the second possibility mentioned above, if your X/Y
coordinate data might include the values "1.E36" or "2.E36", your program's
first action should be to change the values of 'NULL/1.' and 'NULL/2.' to
values which cannot possibly occur in the data.
The parameters 'GRAPH/LEFT.', 'GRAPH/RIGHT.', 'GRAPH/BOTTOM.', and
'GRAPH/TOP.' serve to locate the edges of a rectangular "graph window"
within the plotter frame. The first two are stated as fractions of the
frame width, the second two as fractions of the frame height. These
parameters have the default values "0.", "1.", "0.", and "1., respectively,
specifying a graph window which fills the entire plotter frame.
The graph window is the area in which a graph, including labels, is to
be drawn. A user program may limit a graph to any selected portion of
the plotter frame. For example, changing the values of the parameters
in the group 'GRAPH.' to "0.", ".5", "0.", and ".5", limits a graph to
the lower left-hand quarter of the frame.
See example "agex06".
The parameters 'GRID/LEFT.', 'GRID/RIGHT.', 'GRID/BOTTOM.', and 'GRID/TOP.'
serve to locate the edges of a rectangular area within the graph window;
the parameter 'GRID/SHAPE.' specifies the shape of a "grid window", to be
centered in, and made as large as possible in, this rectangular area. The
positions of the left and right edges are stated as fractions of the
graph-window width and have default values ".15" and ".95"; the positions
of the bottom and top edges are stated as fractions of the graph-window
height and also have default values ".15" and ".95". The parameter
'GRID/SHAPE.' has the default value "0.", specifying a grid window which
completely fills the area specified by the other parameters. Other values
allow one to specify a grid window of any desired rectangular shape or of
a shape implied by the X and Y coordinate data.
The grid window is the portion of the graph window along the edges of
which the axes are to be drawn and within which curves are to be drawn.
Numeric and informational labels are ordinarily placed in the portion of
the graph window which is outside the grid window. Various positioning
parameters are stated in a "grid coordinate system" based on the grid
window and curve-point coordinates are given by the user in a "user
coordinate system" which maps into the grid window. If 'WINDOW.' has the
value "1.", only those curve portions which lie inside the grid window
are drawn. Character sizes and label-offset distances are specified as
fractions of the smaller dimension of the grid window, so as to be in scale
with the rest of the graph.
The routine AGSTUP calls the SPPS routine SET to define the mapping from a
window in "user-coordinate" space to a viewport in "fractional-coordinate"
space. AUTOGRAPH's grid window is synonymous with that viewport.
See example "agex07".
Internally, AUTOGRAPH makes use of a "grid coordinate system"; the user
also makes use of this system at times in setting certain parameter values.
The origin of the grid coordinate system is at the lower left-hand corner
of the grid window. X coordinates run linearly from "0." to "1."
horizontally, and Y coordinates linearly from "0." to "1." vertically,
in the grid window. Note that coordinate values outside the range (0.,1.)
may be used to reference points outside the grid window.
Curve-defining points are stated by a user program in the "user coordinate
system". Fourteen parameters specify how that user coordinate system is
mapped into the grid window. (The parameter 'INVERT.', described below,
might be considered a fifteenth.)
The first seven of the fourteen, named 'X/MINIMUM.', 'X/MAXIMUM.',
'X/LOGARITHMIC.', 'X/ORDER.', 'X/NICE.', 'X/SMALLEST.', and 'X/LARGEST.',
specify how user X coordinates are to be mapped onto the horizontal axis
of the grid window. The default values of these parameters are such that
the routine AGSTUP is forced to:
- Compute, from the user's X-coordinate data, minimum and maximum values
Xm and XM.
- Compute "nice" (rounded) values Xm' and XM' such
that the interval (Xm,XM) is completely contained
in the interval (Xm',XM').
- Map Xm' to the left edge, and XM' to the right
edge, of the grid window. The mapping is linear.
The other seven parameters, named 'Y/MINIMUM.', 'Y/MAXIMUM.', etc., specify
how user Y coordinates are to be mapped onto the vertical axis of the grid
window. The default values specify a mapping analogous to that of X
coordinates.
By changing the values of these fourteen parameters appropriately, a
variety of desirable ends may be achieved:
- Values of Xm, XM, Ym, and/or
YM may be specified, thus limiting the graph to a particular
range of interest and/or forcing consistent scaling of a group of
graphs. If the selection of these values is left up to AUTOGRAPH, a
range of acceptable values may be specified.
- Either or both mappings may be made logarithmic. (The logarithms of
coordinate values are mapped linearly onto the axis.)
- Either or both mappings may be flipped end-for-end. X coordinates may
be made to decrease from left to right, Y coordinates to decrease from
bottom to top.
- The rounding process for either or both mappings may be suppressed,
forcing curves to be plotted full-scale.
The call to the SPPS routine SET that is done by AGSTUP reflects the
current values of all the parameters in the groups 'X.' and 'Y.', as
described above.
See examples "agex06", "agex07"
, and "agex08".
The parameter 'INVERT.' has the default value "0.". If it is set to "1."
by a user program, the routines AGSTUP and AGCURV will behave as if their
X and Y arguments had been interchanged. In some sense, this provides a
way of plotting "X as a function of Y".
This parameter is of principal interest to the users of EZY, EZXY, EZMY,
and EZMXY; those users who call the routines AGSTUP and AGCURV directly
should probably leave the parameter zeroed.
See example "agex08".
A background drawn by the routine AGBACK consists of four axes and up to
eight informational labels, each of the latter having none or more lines
of text; the total number of such lines must not exceed sixteen. Each of
these entities is defined by a group of parameters and may be modified in
a variety of ways.
The four axes are positioned along the edges of the grid window. There
are a left Y axis, a right Y axis, a bottom X axis, and a top X axis.
Each of the axes consists of a line, major tick marks, minor tick marks,
and numeric labels. Numeric labels are placed at major-tick-mark
positions.
The axes are defined by the parameter group named 'AXIS.', which has
subgroups 'AXIS/LEFT.', 'AXIS/RIGHT.', 'AXIS/BOTTOM.', and 'AXIS/TOP.'.
Each of these subgroups contains 23 parameters defining one of the four
axes. These 23 parameters fall into six further subgroups, having the
associated keywords "CONTROL", "LINE", "INTERSECTION", "FUNCTION",
"TICKS", and "NUMERIC".
The default values of the axis parameters specify a "perimeter" background:
All four axes are drawn; each has short, inward-pointing major and minor
ticks; the left axis and the bottom axis have numeric labels (placed
outside the grid window); the right-axis and top-axis numeric labels
are suppressed. See examples "agex01" through "agex04"
.
A "half-axis" background is created by suppressing the right axis and the
top axis completely. A "grid" background is created by extending the
left-axis and bottom-axis ticks all the way across the grid window and
suppressing the ticks on the other two axes. The parameter 'BACKGROUND.'
allows the user to create these standard backgrounds easily; whenever
its value is changed by a user-program call to AGSETI, AGSETF, AGSETP,
or AGSETR, parameters in the group 'AXIS.' are modified to create the
desired background.
See examples "agex05", "agex06"
, and "agex08".
In the ensuing discussions of the various parameters in the group 'AXIS.',
the character "s" is used to stand for any one of the keywords "LEFT",
"RIGHT", "BOTTOM", or "TOP". For example, 'AXIS/s/LINE.' stands for any
one of 'AXIS/LEFT/LINE.', 'AXIS/RIGHT/LINE.', etc. This form is shorter
and makes it clear that four different parameters or groups of parameters
are being described at once.
This parameter may be given any integral value from "-1." to "+4.":
- The value "-1." specifies that only the line portion of the axis
specified by "s" is to be drawn.
- The value "0." specifies that no portion of the axis is to be drawn.
- A value from "1." to "4." specifies that all portions of the axis are
to be drawn and tells AUTOGRAPH what liberties it may take in
attempting to cope with numeric labels which will not fit along the
axis without overlapping.
The precise meanings of each value are described in the section
"PARAMETERS".
This parameter has the default value "0.". Setting it to a "1." causes
the line portion of the axis specified by "s" to be suppressed. Tick
marks and/or numeric labels may still be drawn.
Both of the parameters
'AXIS/s/INTERSECTION/GRID.'
'AXIS/s/INTERSECTION/USER.'
have the default value "null 1", specifying that the axis "s" is to be
drawn in its normal position, along the edge of the grid window. If
either parameter is given a non-null value, the axis "s" is moved away
from its normal position in such a way as to intersect the sides of the
grid which are perpendicular to it at a point specified by that non-null
value. To move an X axis, a Y coordinate is specified; to move a Y axis,
an X coordinate is specified.
The coordinate may be specified in the grid coordinate system or in the
user coordinate system, depending on which parameter is used. If both
parameters are given non-null values, the user-system value takes
precedence.
No axis may be moved outside the graph window. Attempting to do so moves
the axis as far as the edge, but no farther.
See example "agex08".
Each of the four axes has associated with it a "user" coordinate system
(as described above, in the paragraph "THE USER COORDINATE SYSTEM") and
a "label" coordinate system. The routine AGUTOL defines the relationship
between the two coordinate systems for each of the four axes.
Tick marks are positioned at "nice" values in the label coordinate system,
mapped to the user coordinate system, and then mapped onto the axis.
Numeric labels are associated with major ticks and provide values in the
label coordinate system.
The default version of AGUTOL defines the label system on each axis to be
identical with the user system; a private version of AGUTOL may be
substituted in place of the default one in order to change the label
coordinate system for any one or more of the four axes. (Usually, this
can be done by simply compiling one's own version, in which case the
loader will use it rather than the one inside AUTOGRAPH.)
Example: Suppose that the Y-coordinate data is in miles/hour and it is
desired that the left Y axis be tick-marked and labeled in meters/second.
The user program must include a subroutine AGUTOL with five arguments
(four input, one output), as follows:
- the number of the axis being drawn (1, 2, 3, or 4, implying the left,
right, bottom, and top axes, respectively)
- the value of 'AXIS/s/FUNCTION.' for that axis
- an integer specifying whether to map from the user system to the label
system (+1) or vice-versa (-1)
- an input value in one coordinate system
- an output value in the other system
The user routine must, for the left axis only, multiply the input value
by the appropriate constant and return the result as the output value;
for all other axes, it must return an output value equal to the input
value.
It is recommended that the default value of 'AXIS/s/FUNCTION.' (zero) be
used to imply that AGUTOL should do the identity mapping for the axis "s";
other values may be used to select desired mappings. This gives a way to
"turn off" the use of a special mapping for a given axis.
Note that the tick-marking and labeling of one X (Y) axis of a graph may
be completely different from that of the other X (Y) axis of the graph.
For example, the left Y axis could be made to indicate "height in
kilometers" and the right Y axis "pressure in millibars".
See example "agex07".
The parameter group named
'AXIS/s/TICKS/MAJOR/SPACING.'
contains three parameters, with associated keywords TYPE, BASE, and COUNT.
These parameters are described in detail in the section
"PARAMETERS". Major tick marks may be spaced
linearly or logarithmically in the label coordinate system along the
axis specified by "s", or suppressed altogether. Each of the TYPE and
BASE parameters has the default value "null 1", allowing AUTOGRAPH to
position major tick marks as it sees fit.
See examples "agex07", "agex08"
and "agex13".
The parameter
'AXIS/s/TICKS/MAJOR/PATTERN.'
has an integral value from "0." to "65535." and specifies the dashed-line
pattern to be used for major ticks on the axis specified by "s". Each "0"
bit in the lower 16 bits of the integral value specifies a gap 3 plotter
units long, each "1" bit a solid portion 3 plotter units long. The default
value "65535." (216-1) specifies a solid line. The value "0."
may be used to suppress major tick marks on the axis "s".
The parameters
'AXIS/s/TICKS/MAJOR/LENGTH/OUTWARD.'
'AXIS/s/TICKS/MAJOR/LENGTH/INWARD.'
specify the lengths of the outward-pointing and inward-pointing portions
of the major ticks. Each is stated as a fraction of the smaller dimension
of the grid window. If either of these values is made greater than or
equal to "1.", it specifies a tick-mark portion which extends to the edge
of the grid window and a little beyond, the magnitude of the "little
beyond" being specified by the fractional portion of the parameter value;
this can be used to create grids. The default values give inward-pointing
major ticks of length ".015" on all axes.
See example "agex08".
The parameter
'AXIS/s/TICKS/MINOR/SPACING.'
specifies the number of minor ticks which are to occur between pairs of
major ticks on the axis specified by "s". Minor ticks are equidistantly
spaced in the label coordinate system for that axis. The default value
of this parameter is "null 1", allowing AUTOGRAPH to position minor ticks
as it sees fit.
The parameters
'AXIS/s/TICKS/MINOR/PATTERN.'
'AXIS/s/TICKS/MINOR/LENGTH/OUTWARD.'
'AXIS/s/TICKS/MINOR/LENGTH/INWARD.'
specify the dashed-line pattern, outward-pointing length, and
inward-pointing length of minor ticks. They are defined in the same
way as the analogous major-tick parameters, except that the default
inward-pointing tick length is ".010".
See example "agex13".
The parameter group named 'AXIS/s/NUMERIC.' contains eight parameters
describing the numeric labels on the axis specified by "s". These
parameters are described in detail in the section
"PARAMETERS"; they are described sketchily
in succeeding paragraphs.
The parameter named 'AXIS/s/NUMERIC/TYPE.' may be given any integral
value from "0." to "3." or one of the values "null 1" or "null 2".
- The value "0." suppresses numeric labels on the axis specified
by "s".
- The values "1.", "2.", and "3." specify the use of "scientific
notation", "exponential notation", and "no-exponent notation",
respectively.
- A null value gives AUTOGRAPH the freedom to use one of the values
"1.", "2.", or "3." - whichever is most consistent with the label
coordinate system along the axis.
The exact nature of the labels produced by a given value depends on the
three parameters
'AXIS/s/TICKS/MAJOR/SPACING/TYPE.'
'AXIS/s/NUMERIC/EXPONENT.'
'AXIS/s/NUMERIC/FRACTION.'
See examples "agex07" and
"agex13".
The parameters
'AXIS/s/NUMERIC/ANGLE/1ST.'
'AXIS/s/NUMERIC/ANGLE/2ND.'
may have integral values "0.", "90.", "180.", or "270.". They specify the
user's first and second choices for the orientation of numeric labels on
the axis specified by "s". AUTOGRAPH will attempt to use the first choice
(default value: "0." for all axes); if that leads to overlap problems and
shrinking the labels either doesn't help or is not permitted and rotation
is permitted (by the setting of 'AXIS/s/CONTROL.'), AUTOGRAPH may try the
second choice (default value: "90." for all axes).
The values given represent angles measured in degrees counter-clockwise
from horizontal.
The parameter
'AXIS/s/NUMERIC/OFFSET.'
specifies on which side of the axis specified by "s" the numeric labels are
to lie and the size of the gap to be left between the axis line and the
numeric labels:
- A negative value specifies labels inside the grid window.
- A zero value specifies labels centered on the axis, suppresses the
line portion of the axis, and moves the inward-pointing and
outward-pointing portions of ticks out away from the axis so as to
leave room for the labels.
- A positive value specifies labels outside the grid window.
The magnitude of the value specifies the distance from the axis to the
nearest portion of the label, stated as a fraction of the smaller side
of the grid window.
The default value for all axes is ".015".
The parameters
'AXIS/s/NUMERIC/WIDTH/MANTISSA.'
'AXIS/s/NUMERIC/WIDTH/EXPONENT.'
specify the widths of characters in the mantissa and exponent portions of
the numeric labels on the axis specified by "s", stated as fractions of
the smaller dimension of the grid window.
The sizes specified are those desired by the user. If an overlap problem
arises and 'AXIS/s/CONTROL.' is set so as to allow AUTOGRAPH to shrink
the numeric labels, the characters may end up smaller than desired. No
character is shrunk to less than the minimum readable size, however.
These parameters have default values ".015" and ".010", respectively, for
all axes.
As many as m informational labels may be defined at any one time;
normally, m = 8. The informational labels form a part of the background
produced by a call to the routine AGBACK. Each of the informational labels
is defined as follows:
- Each label has a name - a short character string which uniquely
identifies the label.
- Each label has a "suppression flag", which may be set to enable or
disable plotting of the label.
- Each label is positioned relative to a "basepoint", whose X and Y
coordinates are specified in the grid coordinate system. Normally,
the basepoint lies on one edge - but not at a corner point - of the
grid window.
- Emanating from the label basepoint is an "offset vector", whose X
and Y components are specified as signed fractions of the smaller
dimension of the grid window. Normally, the offset vector is used
to specify the size of the gap to be left between an informational
label and the edge of the grid window. The presence or absence of
an axis along that edge of the grid window is ignored when specifying
this gap; see the paragraph
"BACKGROUND OVERLAP PROBLEMS", below.
- Emanating from the end of the offset vector is a "baseline", whose
direction is specified as an angle in degrees ("0.", "90.", "180.",
or "270.", measured counter-clockwise from horizontal). The text
lines of a label are written parallel to, and in the same direction
as, the baseline.
- A centering option for each label determines whether the left edges,
the centers, or the right edges of the text lines are aligned with
the end of the offset vector.
Each label may contain one or more text lines (or none). The total number
of text lines in all labels must not exceed n - normally, n = 16. Each of
the text lines is defined as follows:
- Each text line has an integral position number which distinguishes
it from every other line in the same label. Multiples of "100." are
recommended. Lines with positive position numbers are drawn above the
label baseline, lines with negative position numbers below the label
baseline. A line with position number "0." is centered on the label
baseline. ("Above" and "below" are defined here from the viewpoint
of a reader of the label.) The position numbers of the lines in a
label specify the order in which the lines appear - strictly decreasing
from top to bottom - but do not determine the interline spacing, which
is set by AUTOGRAPH itself.
- Each line has a "suppression flag", which may be set so as to enable
or disable drawing of the line.
- Each line has a character-width specifier, stated as a fraction of
the smaller dimension of the grid window.
- The text of each line is defined by a character string and a count
of the number of characters in the string - normally determined by
AUTOGRAPH itself.
Note: The string replacements
'FLLB(10,8)' => 'FLLB(10,m)'
'QBIM / 8.' => 'QBIM / m.'
where "m" is greater than or equal to 5, may be applied to the AUTOGRAPH
source file to provide for a maximum of "m" labels. Similarly, the string
replacements
'FLLN(6,16)' => 'FLLN(6,n)'
'QNIM / 16.' => 'QNIM / n.'
where "n" is greater than or equal to 5, may be applied to the AUTOGRAPH
source file to provide for a maximum of "n" lines.
The section "PARAMETERS" describes in detail
four "predefined" labels, named 'R', 'L', 'B', and 'T'. Each of these
labels lies along one of the four edges of the grid window - the left
edge, the right edge, the bottom edge, or the top edge.
The predefined labels greatly simplify the task of generating labels
along the edges of the grid window. For example, if you want a "header
label" above the grid window, you need only specify the desired character
string to define the text of line number "100." of the label named 'T'.
The default definitions of the predefined labels specify a label reading
"X" below the grid window and a label reading "Y" to the left of the grid
window.
See examples "agex05", "agex07"
, and "agex13".
The parameter group 'LABEL.' contains 10m+3 parameters - normally, m = 8.
Together with the parameters in the group 'LINE.', they define the
informational labels to be drawn by a call to the routine AGBACK. The
parameters in the group 'LABEL.' are as follows:
- The parameter 'LABEL/CONTROL.' may be given the value "-1." to delete
all currently-defined labels, the value "0." to temporarily disable
the drawing of labels, the value "1." to enable the drawing of labels
and prevent the shrinkage of labels when overlap problems arise, or
the value "2." to enable the drawing of labels and allow shrinkage.
The default value is "2.". See examples "agex05"
and "agex06".
- The parameter 'LABEL/BUFFER/LENGTH.' should not normally be set by a
user program. Its value is m, the maximum number of labels AUTOGRAPH
can handle.
- The subgroup 'LABEL/BUFFER/CONTENTS.' consists of 10m words, in which
the label definitions are stored. Normally, a user program should not
attempt to store values in this block directly. See the paragraph
"ACCESSING A LABEL
DEFINITION", below.
- The parameter 'LABEL/NAME.' is used in the process of accessing a
label definition. It functions as a switch, pointing to the label
definition currently being accessed.
See examples "agex05", "agex07",
and "agex13".
See the section "PARAMETERS" for further
information about these parameters.
The parameter group 'LINE.' contains 6n+4 parameters - normally, n = 16.
They define the lines belonging to the various labels. The parameters in
the group 'LINE.' are as follows:
- The parameters 'LINE/MAXIMUM.' and 'LINE/END.' define the assumed
maximum line length (default - 40 characters) and the line end
character (default - '$'). These parameters come into play when a
user program defines the text of a line. The character string tendered
by the user is assumed to be of maximum length; if it is really shorter
than that, it must be followed by the line end character. See the
examples "agex08" and "agex13"
.
- The parameter 'LINE/BUFFER/LENGTH.' should not normally be set by a
user program. Its value is n, the maximum number of lines AUTOGRAPH
can handle.
- The subgroup 'LINE/BUFFER/CONTENTS.' consists of 6n words, in which
the line definitions are stored. Normally, a user program should not
attempt to store values in this block directly. See the paragraph
"ACCESSING A LINE
DEFINITION", below.
- The parameter 'LINE/NUMBER.' is used in the process of accessing a
line definition. It functions as a switch, pointing to the line
definition currently being accessed.
See the section "PARAMETERS" for further
information about these parameters.
See the examples "agex05", "agex07"
, and "agex13".
To access a label definition, a user program must first execute an AGSETC
call to store the name of the label as the value of 'LABEL/NAME.'. Such a
call does not actually store the name as the value of that parameter.
Instead, it causes the label buffer to be searched for the definition
of the named label. If that definition is not found, a default definition
is made up and inserted in the label buffer. In any case, the index of the
definition is floated and stored as the value of the parameter
'LABEL/NAME.'.
Once 'LABEL/NAME.' has been set in this manner, the parameter group name
'LABEL/DEFINITION.' and subgroup names of the form 'LABEL/DEFINITION/...'
may be used to access the parameters defining the label. These parameters
are as follows:
- The parameter 'LABEL/DEFINITION/SUPPRESSION.' may be given the value
"-2." to delete the label and all of its lines, the value "-1." to
delete the lines of the label but leave the label itself defined, the
value "0." to enable drawing of the label, and the value "1." to
temporarily suppress drawing of the label. It has the default value
"0.". When a label is deleted, 'LABEL/NAME.' and 'LINE/NUMBER.' become
undefined; similarly, when the lines of a label are deleted,
'LINE/NUMBER.' becomes undefined.
- The parameters 'LABEL/DEFINITION/BASEPOINT/X.' and '...Y.' specify
the coordinates, in the grid coordinate system, of the label's
basepoint. The default basepoint is (.5,.5).
- The parameters 'LABEL/DEFINITION/OFFSET/X.' and '...Y.' specify the
components of the label's offset vector, as signed fractions of the
smaller dimension of the grid window. The default vector has zero
components.
- The parameter 'LABEL/DEFINITION/ANGLE.' specifies the angle ("0.",
"90.", "180.", or "270.") at which the label's baseline emanates from
the end of its offset vector. The default angle is "0.".
- The parameter 'LABEL/DEFINITION/CENTER.' has the value "-1." to align
the left ends, the value "0." to align the centers, and the value "+1."
to align the right ends, of the lines of the label with the end of its
offset vector. The default value is "0.".
- The parameters 'LABEL/DEFINITION/LINES.' and 'LABEL/DEFINITION/INDEX.'
are not normally set by a user program; they are maintained by
AUTOGRAPH. The former specifies the number of lines belonging to the
label and the latter specifies the index (in the line buffer) of the
definition of the first line belonging to the label. A default label
has no lines - both of these parameters are zeroed.
See the section "PARAMETERS" for further
information about these parameters.
See examples "agex05", "agex07"
, and "agex13".
To access the definition of one of the lines of a label, a user program
must first access the label definition by setting 'LABEL/NAME.', as
described above. Then, it must execute an AGSETP (or AGSETI) call to store
the number of the desired line as the value of 'LINE/NUMBER.'. Such a call
does not actually store the specified number as the value of that parameter.
Instead, it causes the line buffer to be searched for the definition of the
desired line. If that definition is not found, a default definition is made
up, inserted in the line buffer, and added to the linked list of definitions
of lines belonging to the label. In any case, the index of the definition
is floated and stored as the value of 'LINE/NUMBER.'.
Once 'LINE/NUMBER.' has been set in this manner, the parameter group name
'LINE/DEFINITION.' and subgroup names of the form 'LINE/DEFINITION/...'
may be used to access the parameters defining the line. These parameters
are as follows:
- The parameter 'LINE/DEFINITION/SUPPRESSION.' may be given the value
"-1." to delete the line, the value "0." to enable drawing of the line,
and the value "+1." to temporarily disable drawing of the line. It has
the default value "0.". When a line is deleted, 'LINE/NUMBER.' becomes
undefined.
- The parameter 'LINE/DEFINITION/CHARACTER-WIDTH.' specifies the desired
width of each character in the line, stated as a fraction of the smaller
dimension of the grid window. The default width is ".015".
- The parameter 'LINE/DEFINITION/TEXT.' identifies the character string
comprising the text of the label. The default value is a single blank.
- The parameter 'LINE/DEFINITION/LENGTH.' specifies the length of the
character string. The default value is a "1.".
- The parameter 'LINE/DEFINITION/INDEX.' is not normally set by a user
program. It is maintained by AUTOGRAPH and specifies the index (in the
line buffer) of the next line belonging to the label.
See the section "PARAMETERS" for further
information about these parameters. Also see examples
"agex05" , "agex07", and
"agex13".
Note: As a convenience to the user, an AGSETC call to set
'LINE/DEFINITION/TEXT.' sets both the parameters defining the text of
the label ('...TEXT.' and '...LENGTH.') the latter being computed by
examining the string. The string must be no longer than the length
specified by the value of 'LINE/MAXIMUM.' and, if shorter, it must be
followed by the 'LINE/END.' character.
Each informational label is considered to lie in one of six "label boxes",
as follows:
- Box 1 lies to the left of the grid window. It contains all labels
which have a basepoint on the left edge of the grid window and a
leftward-pointing offset vector.
- Box 2 lies to the right of the grid window. It contains all labels
which have a basepoint on the right edge of the grid window and a
rightward-pointing offset vector.
- Box 3 lies below the grid window. It contains all labels which have a
basepoint on the bottom edge of the grid window and a downward-pointing
offset vector.
- Box 4 lies above the grid window. It contains all labels which have a
basepoint on the top edge of the grid window and an upward-pointing
offset vector.
- Box 5 lies in the interior of the grid window. It contains all labels
which have a basepoint on some edge of the grid window and an
inward-pointing offset vector.
- Box 6 covers the entire grid window and contains all of the remaining
labels.
Three restrictions must be observed by the user:
- No label's basepoint may have coordinates (0.,0.), (0.,1.), (1.,0.),
or (1.,1.); these corner points must be avoided.
- No portion of any label in boxes 1 through 4 may lie inside the grid
window.
- No portion of any label in box 5 may lie outside the grid window.
The label-box concept is important in handling overlap problems, which are
discussed in the next paragraph.
The responsibility for avoiding background overlap problems might
reasonably have been placed squarely on the shoulders of the user, except
for one unpleasant fact: numeric labels are unpredictable critters.
Accordingly, AUTOGRAPH accepts a part of the burden.
In attempting to keep the numeric labels on a given axis from overlapping
each other, AUTOGRAPH may shrink and/or reorient them. Either or both of
these actions may be suppressed by the user by resetting 'AXIS/s/CONTROL.'.
If a problem still exists, some of the labels may be omitted - perhaps
leaving only every second one, every third one, every fourth one, etc.
Informational labels are positioned by the user along the edges of the
grid window as if numeric labels did not exist. AUTOGRAPH takes the
following actions in attempting to prevent the informational labels from
overlapping the numeric labels on any axis:
- Box 1 labels (to the left of the grid window) are moved leftward, box
2 labels (to the right of the grid window) are moved rightward, box 3
labels (below the grid window) are moved downward, box 4 labels (above
the grid window) are moved upward, and box 5 labels (inside the grid
window) are moved inward. Box 6 labels are not moved.
- If, during step 1, a label is shoved outside the graph window by the
numeric labels on some axis, those numeric labels may be shrunk and/or
re-oriented, as allowed by the user's setting of 'AXIS/s/CONTROL.'.
- If one or more of the labels in a given box still lies partly outside
the graph window, the labels in that box may be shrunk, depending on
the current setting of 'LABEL/CONTROL.'. Each label in the box shrinks
toward the end of its offset vector.
- If one or more of the labels in boxes 1 through 4 still lies partly
outside the graph window, all of the labels in that box may be moved
inward, shoving numeric labels ahead of them - onto, and perhaps
across, an axis.
The algorithms used to do all of this are not perfect; if pushed too
severely, they may fail to produce an esthetically pleasing or even
minimally acceptable graph. In such cases, the user must take remedial
action.
Note: None of the actions described above modify any of the parameters
except 'AXIS/s/NUMERIC/ANGLE/1ST.', which may be negated by subtracting
a multiple of "360.". Also, no label is shrunk to less than a readable
size.
The subroutine AGCURV draws curves (one per call). It does this by issuing
calls to the routines DASHD, FRSTD, VECTD, and LASTD, in the DASHCHAR
package. Each curve may thus be drawn using its own particular dashed-line
pattern. One of AGCURV's arguments, called KDSH, specifies the dashed-line
pattern to be used for a given curve:
- If KDSH is zero, the caller is assumed to have done his own call to
DASHD. AGCURV does not call it.
- If KDSH is non-zero, AGCURV calls DASHD.
- If KDSH is positive, its value (modulo n) specifies one of n "user"
patterns, defined by the parameter group named 'DASH.'. See
example "agex07".
- If KDSH is negative, its absolute value (modulo 26) specifies one of
26 "alphabetic" patterns. The curve is drawn using a solid line which
is interrupted periodically by the selected letter of the alphabet.
See example "agex08".
The nature of the "user" set of dashed-line patterns is discussed in the
next paragraph.
The following parameters all belong to the group 'DASH.':
- The parameter 'DASH/SELECTOR.' specifies the type of dashed-line
patterns to be used by the routines EZMY and EZMXY (EZY and EZXY
always use the first of the "user" patterns). If the value of
'DASH/SELECTOR.' is zero or negative, the alphabetic set of (26)
dashed-line patterns will be used; if its value is positive and has
magnitude "n", then the first "n" of the "user" patterns will be used.
The default value is "1.".
- The parameter 'DASH/LENGTH.' specifies the assumed length of
character-string dashed-line patterns; it must be set to the proper
value prior to any AGSETC call setting one of the "user" dashed-line
patterns 'DASH/PATTERN/n.'. The default value is "8.".
- The parameter 'DASH/CHARACTER.' specifies the curve length devoted to
a character other than a dollar sign or a quote in a character-string
dashed-line pattern, stated as a fraction of the smaller side of the
grid window. The default value is ".010".
- The parameter 'DASH/DOLLAR-QUOTE.' specifies the curve length devoted
to a dollar sign (a solid section of the line) or a quote (a gap in
the line), stated as a fraction of the smaller side of the grid window.
The default value is ".010".
- Each of the parameters 'DASH/PATTERN/1.', 'DASH/PATTERN/2.', etc.,
up to 'DASH/PATTERN/26.' defines one of the dash patterns in the
"user" group. Any of the routines AGSETI, AGSETF, or AGSETR may be
used to give one of these parameters a positive integral value
between 0. and 65535., inclusive, in which case the low-order 16
bits of it are interpreted as a dash pattern; the 0 and 1 bits
represent "pen-up" and "pen-down" segments three plotter units long.
The routine AGSETC may be used to (in effect) store a character
string (of the length specified by 'DASH/LENGTH.') as the value of
one of these parameters. In such a character string, a quote represents
a "pen-up" segment of the length specified by 'DASH/DOLLAR-QUOTE.', a
dollar sign represents a "pen-down" segment of that length, and every
other character is simply drawn as a part of the line (with a width
specified by 'DASH/CHARACTER.'). The default value of all 26 parameters
is "65535.".
See examples "agex07" and
"agex08".
Each of the routines EZY and EZXY, which draw one curve per call, calls
AGCURV with KDSH equal to 1, specifying the use of the first of the
"user-defined" set of dashed-line patterns (default - a solid line) for
the single curve to be drawn.
Each of the routines EZMY and EZMXY, which draw one or more curves per
call, calls AGCURV with KDSH equal to ISIGN(I,IDSH), where I is the number
of the curve being drawn and IDSH is the integral value of 'DASH/SELECTOR.'.
This parameter has the default value "1.", specifying the use of the "user"
set of dashed-line patterns (default - solid lines); the value "-1."
specifies the use of the "alphabetic" set.
The parameter 'WINDOW.' has the default value "0.". If it is set to a "1."
by a user program, curves subsequently drawn by the routine AGCURV are
"windowed". This means that only those portions lying inside the grid
window are drawn; the effect is as if one were viewing the curve through
an actual window.
See the example "agex07".
Normally, the routine PWRIT is used for all characters drawn by AUTOGRAPH.
Actually, a routine AGPWRT is called; the default version of that routine
just passes its arguments on to PWRIT. Trying to use PWRITX instead poses
some problems. Because "function codes" may be used in a text string
passed to PWRITX, the length of the string cannot be taken to match the
actual number of characters to be drawn; moreover, PWRITX does not use
the same plotter width for each character in a string. Thus, AUTOGRAPH
cannot properly predict where on a graph a label drawn by PWRITX lies,
which interferes with its handling of overlap problems; also, strings
which are positioned relative to an end-point may not be properly aligned.
Nevertheless, there is a way to make AUTOGRAPH use PWRITX: On a Unix
system, one simply appends a "-agupwrtx" to the "ncargf77" command. This
will cause to be loaded an alternate version of AGPWRT that calls PWRITX.
(If "ncargf77" is not being used, one must append to the "f77" command the
proper name of the library containing the alternate version of AGPWRT; this
name may be obtained from an NCAR Graphics consultant.) When the alternate
version of AGPWRT is used, a string which is centered relative to a given
position (like the "x-axis label", the "y-axis label", or the "graph label")
is drawn directly, in its entirety, by PWRITX, and may therefore contain
function codes to get Greek characters, subscripts, superscripts, etc. A
string which is positioned relative to one end (which includes all numeric
labels) is drawn by passing one character at a time to PWRITX, so that the
same plotter width will be used for each; function codes must not be
included in such strings. The results, while not as pleasing as one would
normally expect from PWRITX, are more than just acceptable.
In my opinion, the "duplex" character set of PWRITX is far superior to the
"complex" set. At present, one uses it by incorporating the following code
at the beginning of one's program, prior to any call to PWRITX (directly or
indirectly):
COMMON /PUSER/ MODE
: : :
MODE = 1
The "new" character-drawing utility called PLOTCHAR, written in 1988, has
supplanted PWRITX. AUTOGRAPH would have to be modified to use PLOTCHAR
properly (taking advantage of PLOTCHAR's ability to compute text-extent
quantities). This used to be on the list of things to be done, but it was
not a trivial task, was never done, and, realistically, will probably never
be done. Nevertheless, there is a way to make AUTOGRAPH use PLOTCHAR in a
way that works pretty well: Compile this version of the routine
AGPWRT along with your program to
replace the default version, and, somewhere in your program, put the
following declaration:
COMMON /PSSFLG/ IFLG
Then, if you want AUTOGRAPH to use PLOTCHAR routines to write all labels,
set IFLG non-zero; otherwise, set IFLG to zero.
It is possible to make AUTOGRAPH use the "new" dash package (written in
1994), called DASHPACK, instead of the old package, called DASHCHAR.
For details, see the example "agdp01".
Three routines - AGCHAX, AGCHCU, and AGCHIL (the default versions of which
do nothing) - are provided solely to be replaced by the user; the
replacement versions may change intensities, line widths, colors, line
styles, etc., for selected portions of a graph. Each is called just
before an object is to be drawn and again just after it has been drawn,
with arguments enabling the user version to completely identify what the
current situation is and to make the appropriate calls. AGCHAX handles
objects which are parts of axes, AGCHCU handles curves, and AGCHIL handles
informational labels.
See the descriptions of these routines, in the section
"ROUTINES".
The routine AGCHNL (the default version of which does nothing) is called
just after the character form of a numeric label has been constructed and
just before it is to be drawn. The user may supply a version of this
routine to transform selected numeric labels in any desired fashion and
return them to AUTOGRAPH. This feature may be used to label an axis with
the names of the months, Roman numerals, etc.
See the description of the routine AGCHNL, in the section
"ROUTINES", and also example
"agex10".
Scattergrams, histograms, and other such specialized "graphs" are not
directly provided for by AUTOGRAPH. Standard procedure is to suppress
the advancing of the frame and the drawing of curves by EZxxx, call EZxxx
with the appropriate X and Y data to generate the background, draw the
desired objects on that background, and then advance the frame.
See examples "agex11" and "agex12"
.
This section describes all of the AUTOGRAPH routines of interest to the
user. With two exceptions, they are subroutines rather than functions.
The subroutines EZY, EZXY, EZMY, and EZMXY provide a quick-and-dirty
graph-drawing capability. The appearance of a graph drawn by one of these
routines may be changed drastically by changing the values of primary
control parameters.
The subroutines ANOTAT and DISPLA are provided principally for historical
reasons. Each allows the user to provide new values for certain primary
control parameters. These parameters may also be set by calls to lower-level
routines.
The subroutines AGSETC, AGSETF, AGSETI, AGSETP, and AGSETR allow the user
to set the values of parameters.
The subroutines AGGETC, AGGETF, AGGETI, AGGETP, and AGGETR allow the user
to get the current values of parameters.
The subroutine AGSTUP must be called prior to calling AGBACK or AGCURV,
both initially and after making any change in the primary control parameters.
It examines the primary control parameters for consistency and computes the
values of required secondary control parameters.
The subroutine AGBACK is called to draw a background.
The subroutine AGCURV is called to draw a single curve.
The subroutines AGSAVE and AGRSTR are called to save/restore the current
state (commonly the default state) of AUTOGRAPH.
The function AGBNCH may be used to obtain the 16-character dash pattern
which is equivalent to a specified 16-bit integer dash pattern.
The function AGDSHN may be used to obtain the 16-character name of a
particular specified dash-pattern parameter.
The subroutine AGUTOL is called by AUTOGRAPH to do the mapping from the
user system to the label system (or vice-versa) along the four axes. The
default version may be replaced by the user to obtain a desired mapping.
The subroutines AGCHAX, AGCHCU, and AGCHIL are called by AUTOGRAPH just
before and just after drawing a particular element of a graph. The default
do-nothing versions may be replaced by a user in order to obtain desired
effects (color, different line styles, etc.).
The subroutine AGCHNL is called by AUTOGRAPH just after the character
representation of a numeric label has been generated and just before it is
to be drawn. The default do-nothing version may be replaced by a user in
order to change the numeric labels in a desired way (to get names of months,
Roman numerals, etc.).
The subroutine AGPWRT is called by AUTOGRAPH to draw a character string. The
default version just calls the plot-package routine PWRIT. This routine may
be replaced by a user version which calls PWRITX, PWRITY, or some other
character-drawer.
Note: User versions of AGUTOL, AGCHAX, AGCHCU, AGCHIL, AGCHNL, and AGPWRT
should not call any other AUTOGRAPH routine. No such call will have a useful
effect, and, at worst, an infinite loop may result.
Draws, in a manner determined by the current values of the control
parameters, a complete graph of a single curve through the points
(I,YDRA(I)), for I from 1 to NPTS. The argument GLAB may be used to
specify a "graph label", to be placed at the top of the graph.
Usage
If the default values of the parameters are unchanged, calling EZY
produces a graph having the following appearance: A "perimeter"
background outlines a grid window which is 8/10 the width and 8/10 the
height of the plotter frame and positioned slightly above and to the
right of center within it. Each edge of the perimeter has short
inward-pointing major and minor tick marks, with major tick marks
occurring at the ends of each edge. Numeric labels below major tick
marks on the bottom edge of the perimeter, increasing in value from
left to right, show the linear mapping of values of I onto the horizontal
(X) axis of the graph; below them is the label "X". Numeric labels to the
left of major tick marks on the left edge of the perimeter, increasing
in value from bottom to top, show the linear mapping of values of YDRA(I)
onto the vertical (Y) axis of the graph; to the left of them is the label
"Y". Above the perimeter is the label specified by "GLAB", if any. The
curve itself is drawn as a solid line within the perimeter. A frame
advance is done after the graph is drawn.
See example "agex01".
The appearance of a graph drawn by EZY may change greatly in response
to parameter changes. See the routines ANOTAT, DISPLA, and AGSETP,
below, and the section "PARAMETERS".
Arguments
YDRA (an input array of type REAL, dimensioned at least NPTS)
defines the Y coordinates of points on the curve. The current value of
'NULL/1.' (default value "1.E36") may be used in YDRA to signal missing
points; curve segments on either side of a missing point are omitted.
NPTS (an input expression of type INTEGER) is the number of curve
points defined by the array YDRA.
GLAB (an input expression of type CHARACTER) defines a new "graph
label". (If the first character of this expression is "CHAR(0)", no new
"graph label" is defined; the current one will continue to be used.) A
character string defining a new graph label must either be of the exact
length specified by the current value of 'LINE/MAXIMUM.' (default: 40
characters), or shorter; if shorter, it must be terminated by the
character defined by the current value of 'LINE/END.' (default: a '$').
The string becomes the new text of line number 100 of the label named
'T'.
Draws, in a manner determined by the current values of the control
parameters, a complete graph of a single curve through the points
(XDRA(I),YDRA(I)), for I from 1 to NPTS. The argument GLAB may be used
to specify a "graph label", to be placed at the top of the graph.
Usage
If the default values of the parameters are unchanged, calling EZXY
produces a graph having the following appearance: A "perimeter"
background outlines a grid window which is 8/10 the width and 8/10 the
height of the plotter frame and positioned slightly above and to the
right of center within it. Each edge of the perimeter has short
inward-pointing major and minor tick marks, with major tick marks
occurring at the ends of each edge. Numeric labels below major tick
marks on the bottom edge of the perimeter, increasing in value from
left to right, show the linear mapping of values of XDRA(I) onto the
horizontal (X) axis of the graph; below them is the label "X". Numeric
labels to the left of major tick marks on the left edge of the perimeter,
increasing in value from bottom to top, show the linear mapping of values
of YDRA(I) onto the vertical (Y) axis of the graph; to the left of them
is the label "Y". Above the perimeter is the label specified by "GLAB",
if any. The curve itself is drawn as a solid line within the perimeter.
A frame advance is done after the graph is drawn.
See example "agex02".
The appearance of a graph drawn by EZXY may change greatly in response
to parameter changes. See the routines ANOTAT, DISPLA, and AGSETP, below,
and the section "PARAMETERS".
Arguments
XDRA (an input array of type REAL, dimensioned NPTS) defines the
X coordinates of points on the curve.
YDRA (an input array of type REAL, dimensioned NPTS) defines the
Y coordinates of points on the curve.
The points on the curve have coordinates (XDRA(I),YDRA(I)), for I from
1 to NPTS. The current value of 'NULL/1.' (default value "1.E36") may
be used to signal missing data in these arrays. If either coordinate
of a point is missing, the point is considered to be missing; curve
segments on either side of a missing point are not drawn. Note: Because
all non-missing coordinates are used in figuring the minimum and maximum
user values along a given axis, it is safest to mark both coordinates
as "missing".
NPTS (an input expression of type INTEGER) is the number of curve
points defined by the arrays XDRA and YDRA.
GLAB (an input expression of type CHARACTER) defines a new "graph
label". (If the first character of this expression is "CHAR(0)", no new
"graph label" is defined; the current one will continue to be used.)
A character string defining a new graph label must either be of the
exact length specified by the current value of 'LINE/MAXIMUM.' (default:
40 characters), or shorter; if shorter, it must be terminated by the
character defined by the current value of 'LINE/END.' (default: a '$').
The string becomes the new text of line number 100 of the label named
'T'.
Draws, in a manner determined by the current values of the control
parameters, a complete graph of one or more curves, each defined by a
set of points (I,YDRA(I,J)) (or (I,YDRA(J,I)), depending on the current
value of 'ROW.'), for I from 1 to NPTS. The curve number J runs from 1
to MANY. The argument GLAB may be used to specify a "graph label", to be
placed at the top of the graph.
Usage
If the default values of the parameters are unchanged, calling EZMY
produces a graph having the following appearance: A "perimeter"
background outlines a grid window which is 8/10 the width and 8/10 the
height of the plotter frame and positioned slightly above and to the
right of center within it. Each edge of the perimeter has short
inward-pointing major and minor tick marks, with major tick marks
occurring at the ends of each edge. Numeric labels below major tick
marks on the bottom edge of the perimeter, increasing in value from
left to right, show the linear mapping of values of I onto the horizontal
(X) axis of the graph; below them is the label "X". Numeric labels to the
left of major tick marks on the left edge of the perimeter, increasing in
value from bottom to top, show the linear mapping of values of YDRA(I,J)
onto the vertical (Y) axis of the graph; to the left of them is the label
"Y". Above the perimeter is the label specified by "GLAB", if any. The
curves themselves are drawn as solid lines within the perimeter. A frame
advance is done after the graph is drawn.
See example "agex03".
The appearance of a graph drawn by EZMY may change greatly in response to
parameter changes. See the routines ANOTAT, DISPLA, and AGSETP, below,
and the section "PARAMETERS".
Arguments
YDRA (an input array of type REAL, dimensioned IDXY x MANY or
IDXY x NPTS, depending on the current value of 'ROW.') defines
curve-point Y coordinates. The current value of 'NULL/1.' (default
value "1.E36") may be used in YDRA to signal missing points; curve
segments on either side of a missing point are omitted.
- If 'ROW.' is positive (the default), the first subscript of YDRA is
a point number and the second is a curve number.
- If 'ROW.' is negative, the order of the subscripts is reversed
("row-wise", as opposed to "column-wise", storage); the first
subscript is a curve number and the second is a point number.
IDXY (an input expression of type INTEGER) defines the first
dimension of the array YDRA, which is required by EZMY in order to index
the array properly.
- If 'ROW.' is positive (the default), IDXY must be greater than or
equal to NPTS.
- If 'ROW.' is negative, IDXY must be greater than or equal to MANY.
MANY (an input expression of type INTEGER) is the number of curves
to be drawn by EZMY.
NPTS (an input expression of type INTEGER) is the number of points
defining each curve to be drawn by EZMY.
GLAB (an input expression of type CHARACTER) defines a new "graph
label". (If the first character of this expression is "CHAR(0)", no new
"graph label" is defined; the current one will continue to be used.) A
character string defining a new graph label must either be of the exact
length specified by the current value of 'LINE/MAXIMUM.' (default: 40
characters), or shorter; if shorter, it must be terminated by the
character defined by the current value of 'LINE/END.' (default: a '$').
The string becomes the new text of line number 100 of the label named
'T'.
Draws, in a manner determined by the current values of the control
parameters, a complete graph of one or more curves, each defined by a
set of points (XDRA(I),YDRA(I,J)) (or (XDRA(I),YDRA(J,I)) or
(XDRA(I,J),YDRA(I,J)) or (XDRA(J,I),YDRA(J,I)), depending on the current
value of 'ROW.'), for I from 1 to NPTS. The curve number J runs from 1
to MANY. The argument GLAB may be used to specify a "graph label", to be
placed at the top of the graph.
Usage
If the default values of the parameters are unchanged, calling EZMXY
produces a graph having the following appearance: A perimeter background
outlines a grid window which is 8/10 the width and 8/10 the height of the
plotter frame and positioned slightly above and to the right of center
within it. Each edge of the perimeter has short inward-pointing major
and minor tick marks, with major tick marks occurring at the ends of
each edge. Numeric labels below major tick marks on the bottom edge of
the perimeter, increasing in value from left to right, show the linear
mapping of values of XDRA(I) onto the horizontal (X) axis of the graph;
below them is the label "X". Numeric labels to the left of major tick
marks on the left edge of the perimeter, increasing in value from bottom
to top, show the linear mapping of values of YDRA(I,J) onto the vertical
(Y) axis of the graph; to the left of them is the label "Y". Above the
perimeter is the label specified by "GLAB", if any. The curves themselves
are drawn as solid lines within the perimeter. A frame advance is done
after the graph is drawn.
See example "agex04".
The appearance of a graph drawn by EZMXY may change greatly in response
to parameter changes. See the routines ANOTAT, DISPLA, and AGSETP, below,
and the section "PARAMETERS".
Arguments
XDRA (an input array of type REAL, dimensioned NPTS or IDXY x MANY
or IDXY x NPTS, depending on the current value of 'ROW.') contains
curve-point X coordinates. The current value of 'NULL/1.' (default value
"1.E36") may be used in XDRA to signal missing points; curve segments on
either side of a missing point are not drawn. Note: Because all
non-missing coordinates are used in figuring the minimum and maximum user
values along a given axis, it is safest to mark both coordinates as
"missing".
- If 'ROW.' has the absolute value "1." (the default), XDRA is
singly-dimensioned. It is subscripted by point number.
- If 'ROW.' has the absolute value "2." or greater, XDRA is
doubly-dimensioned. It is subscripted by point number and curve
number, in that order if 'ROW.' is positive (the default), and in
the reverse order if 'ROW.' is negative.
YDRA (an input array of type REAL, dimensioned IDXY x MANY or
IDXY x NPTS, depending on the current value of 'ROW.') contains
curve-point Y coordinates. The current value of 'NULL/1.' (default
value "1.E36") may be used in YDRA to signal missing points; curve
segments on either side of a missing point are not drawn. Note: Because
all non-missing coordinates are used in figuring the minimum and maximum
user values along a given axis, it is safest to mark both coordinates as
"missing".
- If 'ROW.' is positive (the default), YDRA is subscripted by point
number and curve number, in that order.
- If 'ROW.' is negative, YDRA is subscripted by curve number and point
number, in that order.
IDXY (an input expression of type INTEGER) is the first
dimension of the arrays XDRA (if it is doubly-dimensioned) and YDRA
(unconditionally), required by EZMXY in order to index these arrays
properly.
- If 'ROW.' is positive (the default), IDXY must be greater than or
equal to NPTS.
- If 'ROW.' is negative, IDXY must be greater than or equal to MANY.
MANY (an input expression of type INTEGER) is the number of curves
to be drawn by EZMXY.
NPTS (an input expression of type INTEGER) is the number of points
defining each curve to be drawn by EZMXY.
GLAB (an input expression of type CHARACTER) defines a new "graph
label". (If the first character of this expression is "CHAR(0)", no new
"graph label" is defined; the current one will continue to be used.) A
character string defining a new graph label must either be of the exact
length specified by the current value of 'LINE/MAXIMUM.' (default: 40
characters), or shorter; if shorter, it must be terminated by the
character defined by the current value of 'LINE/END.' (default: a '$').
The string becomes the new text of line number 100 of the label named
'T'.
Changes the values of certain primary control parameters, purportedly
having to do with "annotation" of a graph.
Usage
The subroutine ANOTAT is provided principally for historical reasons.
Each of the parameters referenced by its argument list can be set
individually by means of the routines AGSETC, AGSETF, AGSETP, and/or
AGSETR. In fact, ANOTAT is implemented using calls to these routines.
See example "agex08".
Arguments
XLAB (an input expression of type CHARACTER) defines a new
"x-axis label". (If the first character of this expression is "CHAR(0)",
no new "x-axis label" is defined; the current one will continue to be
used.) A character string defining a new X-axis label must either be of
the exact length specified by the current value of 'LINE/MAXIMUM.'
(default: 40 characters), or shorter; if shorter, it must be terminated
by the character defined by the current value of 'LINE/END.' (default:
a '$'). The string becomes the new text of line number -100 of the
label 'B'.
YLAB (an input expression of type CHARACTER) defines a new
"y-axis label". (If the first character of this expression is "CHAR(0)",
no new "y-axis label" is defined; the current one will continue to be
used.) A character string defining a new Y-axis label must either be
of the exact length specified by the current value of 'LINE/MAXIMUM.'
(default: 40 characters), or shorter; if shorter, it must be terminated
by the character defined by the current value of 'LINE/END.' (default:
a '$'). The string becomes the new text of line number 100 of the label
'L'.
LBAC (an input expression of type INTEGER), if non-zero, must
have the integer value 1, 2, 3, or 4, the real equivalent of which is
to become the new value of 'BACKGROUND.'. (If LBAC is zero, no change
is to be made in the current value.) The value "1" specifies a perimeter
background, the value "2" a grid background, the value "3" a half-axis
background, and the value "4" no background at all.
See the discussion of 'BACKGROUND.', in the section
"PARAMETERS".
LSET (an input expression of type INTEGER), if non-zero, must have
the absolute value 1, 2, 3, or 4, the real equivalent of which is to be
stored (by means of a call to AGSETI) as the new value of 'SET.'. If LSET
is zero, no change is to be made in the current value of 'SET.'.
See the discussion of 'SET.', in the section
"PARAMETERS".
NDSH (an input expression of type INTEGER), if zero, specifies
that no change is to be made in the parameters which specify the
dashed-line patterns to be used for curves.
- If NDSH is non-zero, it specifies an integer value whose real
equivalent is to be stored as the new value of 'DASH/SELECTOR.'
(which has the default value "1.").
- If NDSH is negative, 'DASH/SELECTOR.' is set negative, forcing EZMY
and EZMXY to use internally-defined "alphabetic" patterns for the
MANY curves drawn ("A" for the first, "B" for the second, . . ., "Z"
for the 26th, "A" for the 27th, etc.). The routines EZY and EZXY are
unaffected.
- If NDSH is greater than zero, it must be less than or equal to 26,
and the next argument, DSHC, must contain NDSH dashed-line patterns
comprising the new "user" set of patterns. The fact that
'DASH/SELECTOR.' is set positive forces EZMY and EZMXY to use this
set of patterns. (The routines EZY and EZXY always use the first
pattern in this set.) The contents of the array DSHC are copied to
storage local to AUTOGRAPH and pointers to them are installed as the
values of 'DASH/PATTERNS/1.', '.../2.', etc.
See the discussion of 'DASH.', in the section
"PARAMETERS".
DSHC (an input array of type CHARACTER, dimensioned NDSH) is
meaningful only when NDSH is greater than zero. In this case, it must
be an array of NDSH character strings, each of the length specified by
the current value of 'DASH/LENGTH.'. Each character string represents
a dashed-line pattern; dollar signs mean "pen down", quotes mean
"pen up", and other characters mean "draw me".
See the discussion of 'DASH.', in the section
"PARAMETERS".
Changes the values of certain primary control parameters purportedly
having to do with the "display" of a graph.
Usage
The subroutine DISPLA is provided principally for historical reasons.
Each of the parameters referenced by its argument list can be set
individually by means of the routines AGSETP and/or AGSETI. In fact,
DISPLA is implemented using calls to these routines.
See the example "agex13".
Arguments
LFRA (an input expression of type INTEGER), if non-zero, must
have an integer value, the real equivalent of which is to become the
new value of 'FRAME.'. If LFRA is zero, no change is to be made in the
current value of 'FRAME.'.
- The default value of 'FRAME.' is "1.", specifying that each of the
routines EZY, EZXY, EZMY, and EZMXY is to do a frame advance after
drawing a graph.
- The value "2." specifies no frame advance.
- The value "3." specifies a frame advance before drawing a graph.
LROW (an input expression of type INTEGER), if non-zero, must have
an integer value, the real equivalent of which is to become the new value
of 'ROW.'. If LROW is zero, no change is to be made in the current value
of 'ROW.'. This parameter affects the way in which the routines EZMY and
EZMXY interpret the arguments XDRA and YDRA, as follows:
- If 'ROW.' is positive, the first subscript of YDRA is a point number
and the second subscript is a curve number. If 'ROW.' is negative,
the order of the subscripts is reversed (row-wise, rather than
column-wise, storage).
- If the absolute value of 'ROW.' is "1.", XDRA is singly-subscripted;
its subscript is a point number. If the absolute value of 'ROW.' is
"2." or greater, XDRA is doubly-subscripted; the order of the
subscripts is the same as for YDRA.
The default value of 'ROW.' is "1.", specifying that XDRA is
singly-subscripted by point number and that YDRA is doubly-subscripted
by point number and curve number, in that order.
LTYP (an input expression of type INTEGER), if non-zero, is an
integer specifying new values for 'X/LOGARITHMIC.' and 'Y/LOGARITHMIC.'.
If LTYP is zero, no change is to be made in the current values.
- The parameter 'X/LOGARITHMIC.' has the default value "0.", specifying
a linear mapping of user X coordinates onto the horizontal axis of
the grid window; it may be given either of the two values "-1." or
"+1." to specify a logarithmic mapping. The value "-1." protects it
from being reset as a side effect of setting 'SET.'. DISPLA generates
the value "0." or "-1.".
- The parameter 'Y/LOGARITHMIC.' is defined similarly and affects the
mapping of user Y coordinates onto the vertical axis of the grid
window.
A non-zero LTYP resets these values, as follows:
| LTYP | 'X/LOGARITHMIC.' | 'Y/LOGARITHMIC.' |
| 1 | linear | linear |
| 2 | linear | logarithmic |
| 3 | logarithmic | linear |
| 4 | logarithmic | logarithmic
|
Allows a user program to reset the values of a group of parameters
containing one or more elements.
Usage
The subroutine AGSETP is called with a character string identifying a
group of parameters (possibly a single parameter), an array containing
new values of those parameters, and the length of the array, as arguments.
It transfers the new values into the appropriate locations in the labeled
common block AGCONP, thus modifying the effect of subsequent calls to
other AUTOGRAPH routines.
If a single parameter is being set, one of the routines AGSETC, AGSETF,
AGSETI, or AGSETR (which see, below) may be used instead.
When certain parameters are set individually, AGSETP takes further
"special" action. For example, if 'BACKGROUND.' is set, thereby
requesting one of the standard types of backgrounds, AGSETP changes a
number of other parameters in order to achieve the desired effect. The
parameters which imply such special action are as follows:
'SET.'
'BACKGROUND.'
'NULL/1.' and 'NULL/2.'
'LABEL/CONTROL.'
'LABEL/NAME.'
'LABEL/DEFINITION/SUPPRESSION.'
'LINE/NUMBER.'
'LINE/DEFINITION/SUPPRESSION.'
'LINE/DEFINITION/TEXT.'
See the section "PARAMETERS" for descriptions
of the parameters whose values may be set. Special actions, if any, which
accompany the setting of a parameter are detailed there.
Arguments
TPGN (an input expression of type CHARACTER) is a character string
of the form 'k1/k2/ . . . kn.', where
each of the ki's is a keyword. The keyword k1
specifies a group of parameters, k2 a subgroup of that group,
k3 a subgroup of that subgroup, etc. The whole string is the
name of some group of parameters the user wishes to set.
For example, 'AXIS.' is the name of a 92-word group of parameters
describing the four axes, 'AXIS/RIGHT.' is the name of a 23-word
subgroup describing the right Y axis,
'AXIS/RIGHT/INTERSECTION.'
is the name of a 2-word further subgroup describing the intersection of
the right Y axis with the bottom of the grid window, and
'AXIS/RIGHT/INTERSECTION/USER.'
is the name of a single parameter specifying the point of intersection
of the right Y axis with the bottom of the grid window as an X coordinate
in the user coordinate system.
Obviously, these names can sometimes become rather long. There are
various ways in which they may be shortened. First, since the fifth
and following characters of each keyword are ignored, they may be
omitted; this would shorten
'AXIS/RIGHT/INTERSECTION/USER.'
to
'AXIS/RIGH/INTE/USER.'
Even fewer characters may be used, as long as no ambiguity of
interpretation arises. To be completely safe, use at least the first
three characters of the group keyword and at least the first two
characters of each subgroup keyword; this would shorten the example
above to 'AXI/RI/IN/US.'. Moreover, certain group and subgroup keywords
may be omitted entirely; for example, 'AXI/RI/IN/US.' may be shortened
to 'RI/IN/US.'. Keywords which may be entirely omitted are enclosed in
brackets in the headings in the section
"PARAMETERS".
Names may also be lengthened in various ways in order to improve their
readability. Blanks may be used as desired on either side of a keyword.
Any sequence of characters not including a slash or a period may be
inserted after a keyword, separated from it by at least one blank. For
example, the name
'DASH PATTERN / CHARACTER WIDTH .'
is equivalent to, and considerably more meaningful than,
'DAS/CH.' (or even 'DASH/CHARACTER.')
A complete list of the parameters may be found in the section
"PARAMETERS", below.
FURA (an input array of type REAL, dimensioned LURA) contains
new values for the parameters in the group specified by TPGN, in the
same order as they appear in the group. All parameters have real values
(because of a portability problem which arose in implementing the
routines AGSETF and AGSETR). Those which represent intrinsically
integral quantities have a value of the form "FLOAT(n)", where "n" is
the integral quantity being represented. Some parameters intrinsically
take on character-string values; the real quantity stored as the value
of such a parameter is typically an identifier allowing for later
retrieval of the character string from a character storage area inside
AUTOGRAPH. The routines AGSETC and AGGETC may be used to set/get the
character-string values of such parameters.
LURA (an input expression of type INTEGER) is the length of FURA
(the number of real elements in it). Its value may be less than, equal
to, or greater than, the length of the parameter group specified by TPGN.
The number of values transferred from FURA is the minimum of the two
(but not less than one). This means that if, for example, you only wish
to set the first two parameters of a 100-parameter group, you may do so
by using LURA = 2.
Allows a user program to store a real number as the value of a single
parameter.
Usage
Either of these subroutines transfers the value of FUSR to a local
array FURA, dimensioned 1, and executes the statement
CALL AGSETP (TPGN,FURA,1)
See the description of AGSETP, above. The "special actions" described
there may result from a call to AGSETF or AGSETR.
Arguments
TPGN (an input expression of type CHARACTER) is an parameter
identifier, as described for AGSETP, above. If a group of more than
one parameter is specified, only the first element of that group will
be affected by the call.
FUSR (an input expression of type REAL) is the value to be given
to the parameter specified by TPGN.
Allows a user program to store the real equivalent of an integer as the
value of a single parameter.
Usage
This subroutine stores the value FLOAT(IUSR) in a local array FURA,
dimensioned 1, and then executes the statement
CALL AGSETP (TPGN,FURA,1)
See the description of AGSETP, above. The "special actions" described
there may result from a call to AGSETI.
Arguments
TPGN (an input expression of type CHARACTER) is a parameter
identifier, as described for AGSETP, above. If a group of more than
one parameter is specified, only the first element of that group will
be affected by the call.
IUSR (an input expression of type INTEGER) is the value to be
given to the parameter specified by TPGN.
Allows a user program to (in effect) store a character string as the
value of a specified single parameter.
Usage
This subroutine stores the character string CUSR in an internal string
storage space, generates a real identifier allowing for later retrieval
of the character string, stores that identifier in a local array FURA,
dimensioned 1, and then executes the statement
CALL AGSETP (TPGN,FURA,1)
See the description of AGSETP, above. The "special actions" described
there may result from a call to AGSETC.
Arguments
TPGN (an input expression of type CHARACTER) is a parameter
identifier, as described for AGSETP, above. The specified parameter
must be one of those which intrinsically have values of type character:
'LINE/END.', 'LABEL/NAME.', 'LINE/TEXT.', or 'DASH/PATTERN/n.'
CUSR (an input expression of type CHARACTER) is the desired
character string.
- If 'LINE/END.' is being set, only the first character of CUSR will
be used.
- If 'LABEL/NAME.' is being set, the length of the string CUSR will
be taken to be "MAX(1,LEN(CUSR))".
- If the text of a label is being set, CUSR must either be of the
exact length specified by 'LINE/MAXIMUM.' (40 characters, by
default) or shorter; if shorter, it must be terminated by the
character defined by 'LINE/END.' (default: a '$').
- If a dash pattern is being set, the length of CUSR will be taken
to be the minimum of "LEN(CUSR)" and the value specified by
'DASH/LENGTH.'.
Allows a user program to get the values of a group of parameters containing
one or more elements.
Usage
The subroutine AGGETP is called with a character string identifying a
group of parameters (possibly a single parameter), an array to receive
the values of those parameters, and the length of the array, as
arguments. It transfers values from the appropriate locations in the
labeled common block AGCONP to the user array.
If a single parameter is being retrieved, one of the routines AGGETC,
AGGETF, AGGETI, or AGGETR (which see, below) may be used instead. No
"special" action is implied for any single parameter (as is the case
for AGSETP).
See the section "PARAMETERS" for descriptions
of parameters whose values may be retrieved.
Arguments
TPGN (an input expression of type CHARACTER) is a character
string of the form 'k1/k2/ . . . kn.',
where each of the ki's is a keyword. The keyword k1
specifies a group of parameters, k2 a subgroup of that group,
k3 a subgroup of that subgroup, etc. The whole string is the
name of some group of parameters the user wishes to get.
See the AGSETP argument TPGN, above, for an example and additional
comments.
FURA (an output array of type REAL, dimensioned LURA) is the
user array into which the real values of the parameters in the group
specified by TPGN are to be transferred, in the same order as they
appear in the group.
See the AGSETP argument FURA, above, for additional comments.
LURA (an input expression of type INTEGER) is the length
of FURA. Its value may be less than, equal to, or greater than, the
length of the group specified by TPGN. The number of values transferred
into FURA is the minimum of the two (but not less than one). You may,
for example, get the first two parameters of a 100-parameter group by
using LURA = 2.
Allows a user program to retrieve the real value of a single parameter.
Usage
Either of these subroutines executes the statement
CALL AGGETP (TPGN,FURA,1)
where FURA is a local array, dimensioned 1, and then sets FUSR equal to
FURA(1).
See the description of AGGETP, above.
Arguments
TPGN (an input expression of type CHARACTER) is a parameter
identifier, as described for AGGETP, above. If a group of more than
one parameter is specified, only the first element of that group will
be retrieved by the call.
FUSR (an output variable of type REAL) receives the real value
of the parameter specified by TPGN.
Allows a user program to retrieve the integer equivalent of the real
value of a single parameter.
Usage
This subroutine executes the statement
CALL AGGETP (TPGN,FURA,1)
where FURA is a local array, dimensioned 1, and then sets IUSR equal
to IFIX(FURA(1)).
See the description of AGGETP, above.
Arguments
TPGN (an input expression of type CHARACTER) is a parameter
identifier, as described for AGGETP, above. If a group of more than
one parameter is specified, only the first element of that group will
be retrieved by the call.
IUSR (an output variable of type INTEGER) receives the integer
equivalent of the real value of the parameter specified by TPGN.
Allows a user program to retrieve (in effect) the character-string values
of certain single parameters.
Usage
This subroutine executes the statement
CALL AGGETP (TPGN,FURA,1)
where FURA is a local array, dimensioned 1. It then retrieves, from
AUTOGRAPH's character storage space, the character string identified
by FURA(1), and returns that string as the value of CUSR.
See the description of AGGETP, above.
Arguments
TPGN (an input expression of type CHARACTER) is a parameter
identifier, as described for AGGETP, above. The specified parameter
must be one of those which intrinsically have values of type character:
'LINE/END.', 'LABEL/NAME.', 'LINE/TEXT.', or 'DASH/PATTERN/n.'
CUSR (an output variable of type CHARACTER) receives the desired
character string. If CUSR is too short, only the beginning of the string
will be put in it. If CUSR is too long, it will be padded with blanks
on the end.
(The remaining arguments are YDRA, NVIY, IIVY,
NEVY, and IIEY.)
Performs "set-up" tasks required before AGBACK and AGCURV may be called.
Basically, AGSTUP examines the current values of the primary control
parameters for errors and computes from them and from its arguments the
values of secondary control parameters. The primary and secondary control
parameters together determine how the routines AGBACK and AGCURV will
behave.
Usage
The subroutine AGSTUP should be called once per graph, just prior to
the sequence of calls to AGBACK and/or AGCURV which actually draws the
graph.
Note that each of the routines EZY, EZXY, EZMY, and EZMXY unconditionally
executes a call to AGSTUP (via a routine called AGEZSU) before calling
AGBACK and/or AGCURV.
An appropriate call to the plot-package routine SET is executed by
AGSTUP. This is important; it allows the user to position things on
the graph using X/Y coordinates that are commensurate with his/her
data.
Arguments
The first five arguments of AGSTUP are meaningful only if at least one
of 'X/MINIMUM.' and 'X/MAXIMUM.' has the value "null 1" or "null 2",
specifying that AUTOGRAPH is to determine for itself the minimum and/or
maximum X coordinate in the user's data. Similarly, the second five
arguments are meaningful only if at least one of 'Y/MINIMUM.' and
'Y/MAXIMUM.' has the value "null 1" or "null 2".
XDRA (an input array of type REAL, dimensioned as implied by the
next four arguments) contains user X coordinates.
NVIX (an input expression of type INTEGER) is the number of
"vectors" of data from XDRA to be considered in computing the minimum
and/or maximum X values.
IIVX (an input expression of type INTEGER) is the index increment
between two "vectors" in XDRA. The 1st element of the first vector is
XDRA(1), the 1st element of the second vector is XDRA(1+IIVX), the 1st
element of the third vector is XDRA(1+IIVX*2), etc.
NEVX (an input expression of type INTEGER) is the number of
elements of each vector in XDRA to be considered in computing the
minimum and/or maximum X values.
IIEX (an input expression of type INTEGER) is the index increment
between two consecutive elements of a vector in XDRA. The second element
of the 1st vector is XDRA (1+IIEX), the third element of the 1st vector
is XDRA(1+IIEX*2), etc. If IIEX has the value 0, the contents of XDRA
are ignored completely; the minimum and maximum X values are considered
to be "1." and FLOAT(NEVX), respectively.
YDRA, NVIY, IIVY, NEVY, and IIEY are
used similarly, but define the user Y coordinates.
Some examples:
| X array | Data to use | XDRA | NVIX | IIVX | NEVX | IIEX |
| X(100) | all data | X(1) | 1 | - | 100 | 1 |
| | ( X(I), I = 1,99,2 ) | X(1) | 1 | - | 50 | 2 |
| | ( X(I), I = 51,99,2 ) | X(51) | 1 | - | 25 | 2 |
| X(10,10) | all data | X(1,1) | 10 | 10 | 10 | 1 |
| | | X(1,1) | 1 | - | 100 | 1 |
| | ( ( X(I,J), I = 1,10 ), J = 1,6 ) | X(1,1) | 6 | 10 | 10 | 1 |
| | | X(1,1) | 10 | 1 | 6 | 10 |
| | | X(1,1) | 1 | - | 60 | 1 |
| | ( ( X(I,J), I = 3,7 ), J = 3,9 ) | X(3,3) | 7 | 10 | 5 | 1 |
| | | X(3,3) | 5 | 1 | 7 | 10 |
| | ( ( X(I,J), I = 3,7,4 ), J = 3,9,3 ) | X(3,3) | 3 | 30 | 2 | 4 |
| none | 1., 2., . . ., 62. | - | - | - | 62 | 0
|
Note: The character "-" is used above to indicate an argument which is
ignored and may be given a dummy value.
Normally, the X and Y coordinate data tendered to AGSTUP are the same
data which will later be used to draw curves. However, this need not be
the case. For example, one could call AGSTUP with a two-word XDRA
(setting NVIX=1, IIVX=1, NEVX=2, and IIEX=1) containing a desired
minimum and maximum to be used, disregarding the real data.
If 'INVERT.' is given the value "1." (in place of its default value
"0."), AGSTUP will behave as if its first five arguments had been
interchanged with its last five, so that X-coordinate values refer to
vertical distances, and Y-coordinate values to horizontal distances,
on the graph. This parameter affects AGCURV in a similar manner, thus
allowing one to plot "X as a function of Y".
Draws the background specified by the current values of the control
parameters - the primary parameters with default values or with values
supplied by the user, and the secondary parameters with values computed
by AGSTUP.
Usage
Just call it. See the section "PARAMETERS"
for descriptions of the parameters which affect the appearance of a
background drawn by AGBACK. See also the description of AGSTUP, above.
An appropriate call to the plot-package routine SET is executed by
AGBACK. This is the same call that was done by AGSTUP; it is re-executed
in case the user has done his/her own call to SET in the interim.
Arguments
None.
Draws a curve in a manner specified by the current values of the control
parameters - the primary parameters with default values or with values
supplied by the user, and the secondary parameters with values computed
by AGSTUP.
Usage
The subroutine AGCURV, given the X and Y coordinates of a set of data
points, draws the curve defined by those points, using a dashed-line
pattern selected by the final argument.
See the section "PARAMETERS" for a description
of the parameters which affect the behavior of AGCURV. One parameter of
particular interest is 'WINDOW.', which has the default value "0.". If
'WINDOW.' is given the value "1.", any portion of a curve which lies
outside the grid window is omitted. No distortion of any curve segment
results; the effect is exactly as if the curve were viewed through a
window. There is an additional advantage in setting 'WINDOW.' to "1.":
if either the X coordinates, or the Y coordinates, or both, are mapped
logarithmically into the grid window and zero or negative values occur
in the data, AGCURV treats those values as missing-point signals, rather
than bombing with an ALOG10 error.
Arguments
XVEC (a singly-subscripted input array of type REAL), when IIEX
is non-zero, contains NEXY X-coordinate data - curve point 1 has X
coordinate XVEC(1), curve point 2 has X coordinate XVEC(1+IIEX), curve
point 3 has X coordinate XVEC(1+IIEX*2), etc. When IIEX is zero, the
array XVEC is ignored - curve point 1 has X coordinate "1.", curve
point 2 has X coordinate "2.", etc.
If the value of any X coordinate matches the current value of 'NULL/1.'
(default - "1.E36"), the corresponding point is considered to be missing
- curve segments on either side of that point are not drawn.
IIEX (an input expression of type INTEGER), if non-zero, is the
index increment between one X coordinate in XVEC and the next. If IIEX
is zero, the array XVEC is ignored, as described above.
YVEC (a singly-subscripted input array of type REAL) is just
like XVEC, but provides Y coordinate data.
IIEY (an input expression of type INTEGER) is just like IIEX,
but describes the use (or non-use) of YVEC.
NEXY (an input expression of type INTEGER) is the number of
curve points - the number of X/Y coordinate pairs to be used.
Note: If 'INVERT.' is given the value "1." (in place of its default
value "0."), AGCURV will behave as if the arguments XVEC and IIEX had
been interchanged with the arguments YVEC and IIEY, so that X-coordinate
values refer to vertical distances, and Y-coordinate values to horizontal
distances, on the graph. This parameter affects AGSTUP in a similar
manner, thus allowing one to plot "X as a function of Y".
KDSH (an input expression of type INTEGER) specifies the
dashed-line pattern to be used in drawing the curve. (Since the
routines DASHD, FRSTD, VECTD, and LASTD, in the package DASHCHAR,
are used to draw the curve, it may have its own particular dashed-line
pattern.)
- If KDSH is zero, the user is assumed to have done his own call to
DASHD; AGCURV will do no such call.
- If KDSH is non-zero and negative, the function MOD(-KDSH-1,26)+1
determines which of 26 "alphabetic" patterns is to be used; each
of these generates a solid line interrupted by one of the letters
of the alphabet. The value 1 implies that an "A" will be used, the
value 2 that a "B" will be used, . . . the value 27 that an "A" will
be used again, etc.
- If KDSH is non-zero and positive, the function MOD(KDSH-1,n)+1
determines which of n "user" patterns is to be used; these n
patterns are defined by the parameters in the group named 'DASH.'
- the default values specify one solid-line pattern.
Note: The routines EZY and EZXY, which draw one curve per call, always
call AGCURV with KDSH = 1. The routines EZMY and EZMXY, which draw one
or more curves per call, call AGCURV with KDSH = ISIGN(p,q), where p
is the number of the curve being drawn (p is between 1 and MANY,
inclusive) and q is the current integral value of 'DASH/SELECTOR.'.
Saves the current state of AUTOGRAPH for later restoration by AGRSTR.
Usage
Calling AGSAVE saves the current state of AUTOGRAPH (frequently the
default state) by writing, on the unit specified by IFNO, the current
values of all the parameters and the contents of the character storage
space referenced by certain of those parameters.
Arguments
IFNO (an input expression of type INTEGER) is the number of a
unit to which a single unformatted record is to be written. It is the
user's responsibility to position this unit. AGSAVE does not rewind it,
either before or after writing the record.
Restores a saved state of AUTOGRAPH.
Usage
Calling AGRSTR restores AUTOGRAPH to a previously saved state
(frequently the default state) by reading, from the unit specified
by IFNO, values of all the parameters and the contents of the character
storage space referenced by certain of those parameters.
Arguments
IFNO (an input expression of type INTEGER) is the number of a
unit from which a single unformatted record is to be read. It is the
user's responsibility to position this unit. AGRSTR does not rewind
it, either before or after reading the record.
Provides an easy way to convert binary dash patterns into character dash
patterns.
Usage
AGBNCH is a function, of type CHARACTER*16, and must be declared as
such in a user program referencing it, by including the statement:
CHARACTER*16 AGBNCH
The value of AGBNCH (IDSH), where IDSH is an integer in the range 0
to 65535 (216-1) representing a 16-bit binary dash pattern,
is the equivalent character dash pattern.
Arguments
IDSH (an input expression of type INTEGER) is between 0 and
65535, inclusive.
Provides an easy way to generate the names of parameters in the group
'DASH/PATTERN.', for use in calls to AGSETC and AGGETC.
Usage
AGDSHN is a function, of type CHARACTER*16, and must be declared as
such in a user program referencing it, by including the statement:
CHARACTER*16 AGDSHN
The value of AGDSHN (IDSH), where IDSH is an integer "n" in the range
1 to 26, is the name of the nth dash-pattern parameter - that is to
say, it is the character string 'DASH/PATTERN/n.'.
Arguments
IDSH (an input expression of type INTEGER) is between 1 and 26,
inclusive.
Provides a way for the user to change the user-system-to-label-system
mapping for one or more of the four axes.
Usage
This ro