linestyle

Each terminal has a default set of line and point types, which can be seen by using the command test. set linestyle defines a set of line types and widths and point types and sizes so that you can refer to them later by an index instead of repeating all the information at each invocation.

Syntax:

      set linestyle <index> {linetype | lt <line_type>}
                            {linewidth | lw <line_width>}
                            {pointtype | pt <point_type>}
                            {pointsize | ps <point_size>}
      set nolinestyle
      show linestyle

The line and point types are taken from the default types for the terminal currently in use. The line width and point size are multipliers for the default width and size (but note that <point_size> here is unaffected by the multiplier given on 'set pointsize').

The defaults for the line and point types is the index. The defaults for the width and size are both unity.

Linestyles created by this mechanism do not replace the default styles; both may be used.

Not all terminals support the linewidth and pointsize features; if not supported, the option will be ignored.

Note that this feature is not completely implemented; linestyles defined by this mechanism may be used with 'plot', 'splot', 'replot', and 'set arrow', but not by other commands that allow the default index to be used, such as 'set grid'.

Example: Suppose that the default lines for indices 1, 2, and 3 are red, green, and blue, respectively, and the default point shapes for the same indices are a square, a cross, and a triangle, respectively. Then

      set linestyle 1 lt 2 lw 2 pt 3 ps 0.5

defines a new linestyle that is green and twice the default width and a new pointstyle that is a half-sized triangle. The commands

      set function style lines
      plot f(x) lt 3, g(x) ls 1

will create a plot of f(x) using the default blue line and a plot of g(x) using the user-defined wide green line. Similarly the commands

      set function style linespoints
      plot p(x) lt 1 pt 3, q(x) ls 1

will create a plot of f(x) using the default triangles connected by a red line and q(x) using small triangles connected by a green line.