Setting Line Attributes

The graph drawing routines may be freely mixed with those described in this section which allow the user to control line colour and styles. The attributes set up by these routines apply modally, i.e, all subsequent objects (lines, characters and symbols) plotted until the next change in attributes are affected in the same way. The only exception to this rule is that characters and symbols are not affected by a change in the line style, but are always drawn using a continuous line.

Line colour is set using the routine plcol. The argument is ignored for devices which can only plot in one colour but some terminals support line erasure by plotting in colour zero. For HP plotters, these colours map to the various pens.

Line style is set using the routine plstyl. A broken line is specified in terms of a repeated pattern consisting of marks (pen down) and spaces (pen up). The arguments to this routine consist of the number of elements in the line, followed by two pointers to integer arrays specifying the mark and space lengths in micrometres. Thus a line consisting of long and short dashes of lengths 4 mm and 2 mm, separated by spaces of length 1.5 mm is specified by:

MARK[0]=4000;
MARK[1]=2000;
SPACE[0]=1500;
SPACE[1]=1500;
plstyl(2,MARK,SPACE);
To return to a continuous line, just call plstyl with first argument set to zero.