There are two constructors for the GMatrix class. The first takes a void argument which is useful when setting up pointers to GMatrices. The second constructor takes one or two arguments. The first argument is a kx2 matrix where k is the number of rows. The first column is the x data and the second is the y data. The second argument is the symbol to be plotted. The points of the graph will be connected by a line if the symbol has a negative sign. It will be just the symbol if the sign is positive. The default symbol produces a wiggly line plot.
The Show function is fairly complicated, so I will devote a section to it later.
The function AddVec()
lets you
overlay graphs. It actually concatenates the new matrix and
updates the graph number and symbol. The arguments are the same
as the constructor above.
There are several ways to annotate the graph.
There are four strtype pointers
for locating text. The two titles, title
and
title2
, are placed on the top center of the screen. The
xname
is the x-axis name and is placed at the
bottom center beneath the graph. The yname
is the y-axis
name and is placed above the y-axis. Note that these for
parameters are pointers so the need a '*' in front of it to
store a value. I made them pointers so they only take a pointer
from the stack instead of the space required for a full strtype.
These strings are deleted by the destructor.
There are three booleans for grid display options.
RectangleOn
determines whether or not to draw a rectangle
instead of just the x and y axes. Its default value is TTRUE.
Reference lines may be drawn at the tick marks by changing
XGridOn
or YGridOn
to TTRUE.
Horizontal and vertical reference lines may also be placed at
arbitrary locations using the functions Href()
and
Vref()
. The user can
specify at most 20 reference lines. The members are stored in a
circular fashion: the 21'st reference line overwrites the 1'st
reference line. The reference lines can be cleared by the
functions ClearHref()
and ClearVref()
.
You can save the graph matrix using the SaveGraph()
command. The argument is a file
name to write the ASCII version of the matrix. You can then
retrieve the data into a more sophisticated graphics program.