Graphs are objects which hold a series of datapoints, each consisting of N values (where N is the number of columns in a graph, if a graph is imagined as a table). The graph class provides all properties of such objects, and dgraph (for holding data points) and fgraph (for holding function values) are two realizations of this base class.
According to the general design concepts, setting or reading graph properties can be done via member functions with the same name, so here only the setting version will be presented. Properties are usually compound words (like linewidth), and this name is used as the member function name. There are usually shorthands as well, consisting of the initial letters of the parts of this compound word (in the case of linewidth the shorthand is lw). Graph properties include the following:
graph &drawstyle(const graph_drawer &); graph &ds (const graph_drawer &); // a shorthand for the previous oneNote that the argument of this function is a reference to an object. This object will be clone-copied inside the function, so the original object is left untouched. This means that one has to construct a graph_drawer object, i.e. call its constructor. In addition, modifying member functions can immediately be called on the (temporary) object, for example:
plot("...").ds(vectors().use_color(true));Here, vectors() creates a temporary object of type vectors, and we immediately call a member function of this object to set a flag (use a color scale as well to indicate the lengths of the arrows)
graph &fillcolor(const color &c); graph &fc (const color &c); // shorthandCalling this function automatically switches the fill property of the graph to true (see below), since usually one does not set the fillcolor of a graph if he does not want to fill it
graph &fill(bool);
graph &linecolor(const color &); graph &lc (const color &); // shorthand
graph &linewidth(const length &d); graph &lw (const length &d); // shorthand
graph &linestyle(sym::linestyle); graph &ls (sym::linestyle); //shorthand
graph &pointtype(point_drawer &); graph &pt (point_drawer &);
graph &pointsize (const length &); graph &ps (const length &); //shorthand
graph &pointcolor (const color &); graph &pc (const color &); //shorthand
graph &legend(const var &); // no shorthand exists
graph &legendcolor(const color &); // no shorthand
graph &xmin(double); graph &xmax(double); graph &xrange(double,double);and similar functions for the yrange
Source files: graph.h graph.cc dgraph.h (data graph) dgraph.cc fgraph.h (function graph) fgraph.cc