Opens a graphics device and draws a graph
displaying a supplied set of points. Each point is defined by an X and Y value, plus an optional error
bar. An AST Plot is returned so that the calling application can add further graphics to the plot
if needed. When complete, the calling application should annul the Plot, and close the
workstation:
CALL AST_ANNUL( IPLOT, STATUS ) CALL AGP_DEASS( ’
DEVICE’
, .FALSE., STATUS
)
Various environment parameter names are used by this routine, to encourage uniformity in parameter
naming, and behaviour. See KPG1_GRPHW for details.
CALL KPG1_GRAPH( N, X,
Y, NSIGMA, YSIGMA, XLAB, YLAB, TTL, XSYM, YSYM, MODE, NULL, XL, XR, YB, YT,
APP, QUIET, LMODE, BSCALE, IPLOT, STATUS )
N = INTEGER (Given)
Number of points
X( N ) = REAL (Given)
X value at each point. These are scaled by the
value supplied in BSCALE(1) to generate the axis labels.
Y( N ) = REAL (Given)
Y value
at each point. These are scaled by the value supplied in BSCALE(2) to generate the axis
labels.
NSIGMA = REAL (Given)
Controls the length of the vertical error bars. A value
of zero suppresses error bars. Otherwise error bars are drawn which extend by from Y -
NSIGMAYSIGMA
to Y
NSIGMAYSIGMA.
YSIGMA( N ) = REAL (Given)
The standard deviation associated with each Y value.
XLAB =
CHARACTER
(
) (Given)
A default label for the X axis. Only used if the user does not supply an
alternative. Trailing spaces are ignored. If a Plot is supplied via IPLOT, then the "
Label(1)"
attribute in the Plot is used as the default in preference to XLAB.
YLAB = CHARACTER
(
) (Given)
A default label for the Y axis. Only used if the user does not supply an
alternative. Trailing spaces are ignored. If a Plot is supplied via IPLOT, then the "
Label(2)"
attribute in the Plot is used as the default in preference to YLAB.
TTL = CHARACTER
(
) (Given)
A
default title for the plot. Only used if the user does not supply an alternative. If a Plot is supplied via IPLOT,
then the "
Title"
attribute in the Plot is used as the default in preference to TTL.
XSYM = CHARACTER
(
) (Given)
The default symbol for the horizontal axis. Only used if the user does not supply an alternative. This
will be stored with the Plot in the AGI database and (for instance) used by CURSOR as axis symbols
when displaying the cursor positions on the screen. If a Plot is supplied via IPLOT, then the "
Symbol(1)"
attribute in the Plot is used as the default in preference to XSYM.
YSYM = CHARACTER
(
)
(Given)
The default symbol for the horizontal axis. Only used if the user does not supply an
alternative. This will be stored with the Plot in the AGI database and (for instance) used by CURSOR
as axis symbols when displaying the cursor positions on the screen. If a Plot is supplied via IPLOT,
then the "
Symbol(2)"
attribute in the Plot is used as the default in preference to XSYM.
MODE =
INTEGER (Given)
Determines the way in which the data points are represented: 1 - A "
staircase"
histogram, in which each horizontal line is centred on the X position. Bad values are flanked by
vertical lines drawn down to the lower edge of the viewport. 2 - The points are joined by straight lines.
3 - A marker is placed at each point (see MTYPE). 4 - (not used) 5 - A "
chain"
in which each point
is marker by a marker and also join by straight lines to its neighbouring points. 6 - The
same as Mode 1, except that bad values are not flanked by vertical lines drawn down to
the lower edge of the viewport (a simple gap is left instead). 7 - The data points are not
drawn.
NULL = LOGICAL (Given)
If .TRUE., then the user may supply a null (!) value for
most of the parameters accessed by this routine to indicate that nothing is to be plotted. In
this case, no error is returned. Otherwise, a PAR__NULL error status is returned if a null
value is supplied.
XL = REAL (Given)
The default value for the XLEFT parameter. If
VAL__BADR is supplied, the minimum of the X values is used (plus a small margin).
XR = REAL (Given)
The default value for the XRIGHT parameter. If VAL__BADR is
supplied, the maximum of the X values is used (plus a small margin).
YB = REAL (Given)
The default value for the YBOT parameter. If VAL__BADR is supplied, the minimum
of the low end of the Y error bars is used (plus a small margin).
YT = REAL (Given)
The default value for the YTOP parameter. If VAL__BADR is supplied, the maximum of
the high end of the Y error bars is used (plus a small margin).
APP = CHARACTER
(
) (Given)
The name of the application in the form "
package_application"
. E.g. "
KAPPA_NORMALIZE"
.
QUIET = LOGICAL (Given)
If .FALSE., a message is displayed
indicating the number of points which were plotted. If .TRUE., nothing is displayed on the alpha
screen.
LMODE = LOGICAL (Given)
If .TRUE., then the user is given the chance to specify the
default vertical bounds for the plot using parameter LMODE. If .FALSE., the supplied bounds (YB, YT
) are used, and the eqivalent of "
Extended"
LMODE is used for any bounds which are not supplied.
BSCALE( 2 ) = DOUBLE PRECISION (Given)
Scale factors which converts the supplied (x,y) values
into the values to label on the plot. A similar BZERO argument could be added if there
is ever a need.
IPLOT = INTEGER (Given and Returned)
On entry, this can either be
AST_NULL or a pointer to a two-dimensional Frame. If AST__NULL, the supplied values
for the XLAB, YLAB, TTL, XSYM and YSYM arguments are used without change. If a
Frame is supplied, the Label, Title, Units and Symbol attributes of the Frame are used in
preference to XLAB, YLAB, TTL, XSYM and YSYM (which are then ignored). Any supplied
Frame pointer is annulled before returning, and a pointer to the Plot used to draw the axes
is returned.
STATUS = INTEGER (Given and Returned)
The global status.