Graph buffers provide the functionality of a buffer with an option to view and print the buffer contents in graphical form. Elements of a graph buffer may take one of two forms: type(DataSet, Type, Properties) or data(DataSet, X, Y), where DataSet identifies a particular data set, Type specifies the type of graph required for that data set (see below), Properties is a list of secondary properties specifying aspects of the appearance of the particular data set (see below), and X and Y are numeric values for the data set. Graph buffer elements may be matched, added or deleted, in a way analogous to elements from other classes of buffer.
There is no limit to the number of data sets that may be stored in one graph buffer. Normally there will be one type/3 element and several data/3 elements for each data set. Multiple data sets within a single graph buffer are treated independently, with the limitation that the graph axes and labels are determined by graph properties (see below), and are hence shared by all data sets within a graph.
A type/3 term specifies the style or type of graph to be drawn for a given data set. The second argument must be one of scatter, line, or bar. The third argument species graph properties such as colour and marker style, in the form of a list of secondary properties. Thus, the following type/3 element:
specifies that the graph associated with frequency should be a bar-chart drawn with blue filled bars. This could be changed to a line graph using red filled square markers (and a red line) by replacing the above element with:
Three kinds of secondary property are recognised: colour, fill, and marker. There are four marker types: square, circle, cross and plus.
Graphical buffers may be viewed as graphs by selecting the "Current Graph" view. Each data/3 element is used to construct a data point on the graph for a particular data set, with the second and third arguments specifying the coordinates (and the first argument specifying the data set). The standard printing procedures may be used to print these tables.
Graph buffers inherit all of the properties of the parent buffer class (Initialise, Decay, Decay Constant, Limited Capacity, Capacity and On Excess). They also have several additional properties that control access and appearance:
Access [Random/FIFO/LIFO; default: Random]:
The order in which the buffer's elements are accessed by match operations. Interpretation of the property's values follows that of propositional buffers.
Title [an arbitrary character string; default: ``Title'']:
The graph's title, which is centred above the graph when viewed in Current Graph mode or when the graph is printed.
X Label [an arbitrary character string; default: ``X'']:
The label drawn beside the graph's horizontal axis.
X Min [a real number; default: 0.0]:
The minimum value of the horizontal coordinate of the graph.
X Max [a real number; default: 10.0]:
The maximum value of the horizontal coordinate of the graph.
X Units [a positive integer: default: 5]:
The number of units into which the horizontal axis of the graph is divided.
Y Label [an arbitrary character string; default: ``Y'']:
The label drawn beside the graph's vertical axis.
Y Min [a real number; default: 0.0]:
The minimum value of the vertical coordinate of the graph.
Y Max [a real number; default: 100.0]:
The maximum value of the vertical coordinate of the graph.
Y Units [a positive integer: default: 5]:
The number of units into which the vertical axis of the graph is divided.