Setting Line Attributes

The graph drawing routines may be freely mixed with those described in this section, allowing the user to control line color, width 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 color is set using the routine plcol0. The argument is ignored for devices which can only plot in one color, although some terminals support line erasure by plotting in color zero.

Line width is set using plwid. This option is not supported by all devices.

Line style is set using the routine plstyl or pllsty. 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 are the number of elements in the line, followed by two pointers to integer arrays specifying the mark and space lengths in micrometers. 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. You can use pllsty to choose between 8 different predefined styles.