1.1 The with modifier

In Chapter 3 an overview of the syntax of the plot command was provided, including a description of the every, index, select and using modifiers which can be used to control which data, read from a datafile or sampled from a function, should be plotted. The with modifier controls how 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 datapoint to 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.

In the following section, a complete list of all of PyXPlot’s plot styles – i.e. all of the words which may be used in place of lines – will be given. In this section, we list all of the modifiers such as line­width which may be used to alter the exact appearance of these plot styles, which are as follows:

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

Not all of these modifiers are applicable to all of PyXPlot’s plot styles. For example, the line­width modifier has no effect on plot styles which do not draw lines between datapoints. Where modifiers are applied to plot styles for which they have no defined effect, the modifier has no effect, but no error results. Table 1.1 lists which modifiers act upon which plot styles.

\includegraphics[width=\textwidth ]{examples/eps/ex_plotstyletab}

Table 1.1: A list of the plot styles affected by each style modifiers.