proc lineplot


Welcome     Gallery     Handbook


Manual page for proc_lineplot(PL)

DESCRIPTION

proc lineplot uses data to draw a line plot. The plot is drawn beginning with first data record, working to the last one.

FEATURES

complete control over color, width, and dash style of line. Options include stairstep lines, point symbols, accumulation, and various labeling options. In addition, the area under the curve may be filled, and the range of the line may be controlled.

EXAMPLES

See the Gallery Lineplot examples

UNPLOTTABLE DATA

Invalid values are skipped; the curve will be drawn to connect only the points corresponding to plottable values. Points and connecting lines lying outside of the plotting area are displayed if possible.

PREREQUISITES

A plotting area must be set up using proc areadef and proc getdata must be executed to access or define some data. The data must be ordered in X.

MODES

This proc can operate in one of these modes:

Y only (points "where they fall"):

By specifying yfield but not xfield, Y values are plotted at consecutive unit locations in X.

X and Y:

By specifying both yfield and xfield, points are plotted at the X,Y locations.

Counting of instances:

By specifying instancemode: yes and accum: yes and no yfield, instances are counted, that is, a Y value of 1 is used, and the results are accumulated.

VARIABLES THAT ARE SET

proc lineplot will set these variables:

XSTART and YSTART - location where the curve started, in data units.

XFINAL and YFINAL - location where the curve ended, in data units.

MANDATORY ATTRIBUTE

The yfield attribute MUST be specified.

ATTRIBUTES

yfield dfield

Data field to use for Y values. Example: yfield: 1

xfield dfield

Data field to use for X values. If not specified, sequential unit locations in X will be used.

linedetails linedetails

Line details for the curve. Example: linedetails: color=red width=2.0 style=2

linerange min [max]

Controls the range (in scaled units) within which the curve will be rendered. Data points falling outside this range will not be rendered. If accumulation is being done, points outside the range will contribute to the accumulated total. If only one value is given, it will be taken as the range minima and the maxima will be the plottable maxima. If not specified, all data points will be rendered. Example: linerange: 1

xstart plotvalue

When plotting at consecutive points in X (no xfield specified), this attribute specifies where to begin the curve. Normally this attribute is not specified and the curve begins at the plot area X minima.

stairstep yes | no

If yes, curve will be drawn stairstep style, as is often seen in life table plots. Default is no. Example: stairstep: yes

accum yes | no

If yes, Y values will be plotted cumulatively, effectively summing them. Default is no. Example: accum: yes

instancemode yes | no

If yes, no Y data is used; instead each data row is counted as 1. This may be useful in plotting cumulative occurances over time. Usually used with accum: yes and groupmode: yes. Not compatible with yfield. Default is no.

groupmode yes | no

If yes, adjacent data rows having the same X value will be summed. Default is no. Not compatible with ptlabelfield.

lastx plotvalue

If specified, the curve will be extended to this point in X unconditionally, using the most recent Y.

label text

A text label to be displayed near the termination point of the curve. Label may include the special variable @YFINAL which will yield the last Y value plotted. Example: label: @YFINAL - Control Group

labeldetails textdetails

Text details for the label. Example: labeldetails: adjust=0.2,0 color=green

legendlabel text

A label to be associated with the current lineplot in the legend. proc legend must be executed later in order to render the legend.

legendsampletype symbol | line+symbol

When a line with point symbols is being done, this controls the corresponding legend sample. You can choose symbol for only the symbol to be displayed in the legend, or line+symbol for both line and symbol to be displayed in the legend. Default is symbol.

numbers yes | no | textdetails

If specified, causes each point to be identified with its value in Y. For stairstep curves, this value is centered between X locations.
Example 1: numbers: yes (uses the defaults)
Example 1: numbers: adjust=0.0,0.2 size=8

numbersformat string

Format to be used with the numbers attribute or in the label if @YFINAL is used. For ordinary numbers it is a "C" printf style format specifier. Example: numbersformat: %3.1 would yield numbers like 2.1.
If using special units in Y, numbersformat can have other values (see AXIS stubformat attribute).

pointsymbol symboldetails

If specified, causes each data point to be marked with a geometric point symbol superimposed on top of the curve. Not applicable to stairstep curves. Example: pointsymbol: shape=triangle color=blue

altsymbol symboldetails
altwhen conditional-expression

If both of these are specified, allows an alternate symbol to be used when the condition specified in altwhen is met. This may be used to highlight certain points, or to use an alternate symbol when two lines overlap. gallery/lineplot5 is an example.

ptlabelfield dfield

If specified, causes each data point to be labeled with the contents of this data field. Example: ptlabelfield: 3

ptlabeldetails textdetails

Text details for point label. Example: ptlabeldetails: adjust=0.2,0 size=7 align=L

ptlabelrange min [ max]

The range within which point marks, labels and number displays are to be rendered. This may be useful in suppressing point labels for X=0. If only one value is given, it will be taken as the range minima and the maxima will be the plottable maxima. If not specified, all data points will be labeled. Example: ptlabelrange 1

lastseglen lenvalue

When doing stairstep line plots using xfield, this may be used to control the length of the last step segment. If this ends in (s) it is taken as a scaled distance; otherwise it is assumed to be an absolute distance. Example: lastseglen: 3(s)

stairoverbars yes | no

This allows proper rendering of stairstep lineplot superimposed upon a bar graph. It effectively shifts the line plot 0.5 units to the right.

select conditional-expression

Allows data rows to be selected for inclusion using a selection expression.


data display engine  
Copyright Steve Grubb


Markup created by unroff 1.0,    June 18, 2001.