11.42.4 with

The with modifier controls the style in which data should be plotted. For example, the statement

plot "data.dat" index 1 using 4:5 with lines

specifies that data should be plotted using lines connecting each data pointto its neighbors. More generally, the with modifier can be followed by a range of settings which fine-tune the manner in which the data are displayed; for example, the statement

plot "data.dat" with lines linewidth 2.0

would use twice the default width of line.

The following is a complete list of all of Pyxplot’s plot styles – i.e. all of the words which may be used in place of lines: arrows_­head, arrows_­no­head, arrows_­two­head, boxes, color­map, contour­map, dots, filled­Region, fsteps, histeps, impulses, lines, lines­Points, lower­Limits, points, stars, steps, surface, upper­Limits, wbox­es, x­Error­Bars, x­Error­Range, XY­Error­Bars, xy­Error­Range, xyz­Error­Bars, XYZ­Error­Range, xz­Error­Bars, xz­Error­Range, y­Error­Bars, y­Error­Range, y­Error­Shaded, yz­Error­Bars, yz­Error­Range, z­Error­Bars, z­Error­Range. In addition, lp and pl are recognised as abbreviations for lines­points; error­bars is recognised as an abbreviation for y­error­bars; error­range is recognised as an abbreviation for y­error­range; and arrows_­two­way is recognised as an alternative for arrows_­two­head.

As well as the names of these plot styles, the with modifier can also be followed by style modifiers such as line­width which alter the exact appearance of various plot styles. A complete list of these is as follows:

  • color – used to select the color in which each dataset is to be plotted. It should be followed either by an integer, to set a color from the present palette (see Section 8.1.1), by a recognised color name, or by an object of type color. This modifier may also be spelt colour.

  • fillcolor – used to select the color in which each dataset is filled. The color may be specified using any of the styles listed for color. May also be spelt fillcolor.

  • linetype – used to numerically select the type of line – for example, solid, dotted, dashed, etc. – which should be used in line-based plot styles. A complete list of Pyxplot’s numbered line types can be found in Chapter 18. May be abbreviated lt.

  • linewidth – used to select the width of line which should be used in line-based plot styles, where unity represents the default width. May be abbreviated lw.

  • pointlinewidth – used to select the width of line which should be used to stroke points in point-based plot styles, where unity represents the default width. May be abbreviated plw.

  • pointsize – used to select the size of drawn points, where unity represents the default size. May be abbreviated ps.

  • pointtype – used to numerically select the type of point – for example, crosses, circles, etc. – used by point-based plot styles. A complete list of Pyxplot’s numbered point types can be found in Chapter 18. May be abbreviated pt.

Any number of these modifiers may be placed sequentially after the keyword with, as in the following examples:

plot 'datafile' using 1:2 with points pointsize 2
plot 'datafile' using 1:2 with lines color red linewidth 2
plot 'datafile' using 1:2 with lp col 1 lw 2 ps 3

Where modifiers take numerical values, expressions of the form $2+1, similar to those supplied to the using modifier, may be used to indicate that each datapoint should be displayed in a different style or in a different color. The following example would plot a data file with points, drawing the position of each point from the first two columns of the supplied data file and the size of each point from the third column:

plot 'datafile' using 1:2 with points pointsize $3