5.4 Special comment lines in data files

Whilst most comment lines in data files – those lines which begin with a hash character – are ignored by Pyxplot, lines which begin with any of the following four strings are parsed:

# Columns:
# ColumnUnits:

# Rows:
# RowUnits:

The first pair of special comments affect the behaviour of Pyxplot when plotting using columns, while the second pair affect the behaviour of Pyxplot when plotting using rows (see Section 3.9.1). Within each pair, the first may be used to tell Pyxplot the names of each of the columns/rows in the data file, while the second may be used to tell Pyxplot the physical units of the values in each of the columns/rows. These special comments may appear multiple times throughout a single data file to indicate changes to the format of the data.

For example, a data file prefixed with the lines

# Columns:      Time   Distance
# ColumnUnits:   s      10*m

contains two columns of data, the first containing times measured in seconds and the second containing distances measured in tens of metres. Note that because the entries on each of these lines are whitespace-separated, spaces are not allowed in column names or within units such as 10*m. This data file could be plotted using any of the following forms equivalently

plot 'data' using Time:Distance
plot 'data' using $Time:$Distance
plot 'data' using 1:2

and the axes of the graph would indicate the units of the data (see Section 8.8.3).