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 datapointto its neighbours. 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_nohead, arrows_twohead, boxes, ColourMap, ContourMap, dots, FilledRegion, fsteps, histeps, impulses, lines, LinesPoints, LowerLimits, points, stars, steps, surface, UpperLimits, wboxes, XErrorBars, XErrorRange, XYErrorBars, XYErrorRange, XYZErrorBars, XYZErrorRange, XZErrorBars, XZErrorRange, YErrorBars, YErrorRange, YErrorShaded, YZErrorBars, YZErrorRange, ZErrorBars, ZErrorRange. In addition, lp and pl are recognised as abbreviations for linespoints; errorbars is recognised as an abbreviation for yerrorbars; errorrange is recognised as an abbreviation for yerrorrange; and arrows_twoway is recognised as an alternative for arrows_twohead.
As well as the names of these plot styles, the with modifier can also be followed by style modifiers such as linewidth which alter the exact appearance of various plot styles. A complete list of these is as follows:
colour – used to select the colour in which each dataset is to be plotted. It should be followed either by an integer, to set a colour from the present palette (see Section 1.1.1), or by a recognised colour name, a complete list of which can be found in Section 8.4. Alternatively, arbitrary colours may be specified by using one of the forms rgb0.1:0.2:0.3, hsb0.1:0.2:0.3 or cmyk0.4:0.3:0.2:0.1, where the colon-separated values indicate the RGB, HSB or CMYK components of the desired colour in the range 0 to 1. This modifier may also be spelt color.
fillcolour – used to select the colour in which each dataset is filled. The colour may be specified using any of the styles listed for colour. May also be spelt fillcolour.
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 7. 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 7. 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 colour 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 colour. The following example would plot a datafile with points, drawing the position of each point from the first two columns of the supplied datafile and the size of each point from the third column:
plot 'datafile' using 1:2 with points pointsize $3