Style

Plots may be displayed in one of four styles: lines, points, linespoints, impulses, or dots. The lines style connects adjacent points with lines. The points style displays a small symbol at each point. The linespoints style does both lines and points. The impulses style displays a vertical line from the X axis to each point. The dots style plots a tiny dot at each point; this is useful for scatter plots with many points.

Default styles are chosen with the set function style and set data style commands.

By default, each function and data file will use a different line type and point type, up to the maximum number of available types. All terminal drivers support at least six different point types, and re-use them, in order, if more than six are required. The LaTeX driver supplies an additional six point types (all variants of a circle), and thus will only repeat after twelve curves are plotted with points.

If desired, the actual line type and point type used for a plot can be specified. Syntax:

        with <style> {<linetype> {<pointtype>}}

Where <style> is either lines, points, linespoints, impulses, or dots. These keywords may be abbreviated. Curly braces denote optional items. The <linetype> and <pointtype> are positive integers, and specify the line type and point type to be used for the plot. Line type 1 is the first line type used by default, line type 2 is the second line type used by default etc.

Examples:

This plots sin(x) with impulses:

        plot sin(x) with impulses

This plots sin(x) with points, cos(x) default:

        plot [-9:30]  sin(x) w points, cos(x)

This plots tan(x) with the default function style, ``data.1'' with lines:

        plot [] [-2:5] tan(x), "data.1" with l

This plots ``leastsq.dat'' with impulses:

        plot 'leastsq.dat' w i

This plots sin(x) and cos(x) with the same line type:

        plot sin(x) with line 1, cos(x) with line 1

This plots sin(x) and cos(x) with linespoints, using the same line type but different point types:

        plot sin(x) with linesp 1 3, cos(x) with linesp 1 4
This plots file ``data'' with points style 3:
        plot "data" with points 1 3
Note that the line style must be specified in order to specify the point style, even when it is irrelevant. Here the line style is 1 and the point style is 3, and the line style is irrelevant.