Graphics are provided through calls to the gnuplot 1 software. Instances of the class Plot2d and Plot_file are used to generate the data and command files required by the call to gnuplot. A plot can be generated using the set_plot2d function.
Upon initialization, a Plot2d object contain an empty graph. Data, title, label and other goodies can be added using the following member functions:
None
This function adds the command specified by the string gcom to the gnuplot command file. Ex: mygraph.addcommand("set grid").
Note: see the gnuplot documentation for the list of commands.
None
This function add the curves specified by the n× 2 matrix data to the plot using the string label for the legend and type for the curve line type. Defined line types are:
See the gnuplot documentation for the description of these line types.
None
This function dumps the current content of the object to stdout.
None
This function calls gnuplot with the current content of the object.
None
This function sets the title of the graph to the string t.
None
This function sets the axis X label of the graph to the string t.
None
This function sets the axis Y label of the graph to the string t.
None
An instance of this class allows the creation of graphics from a data file. This file has to be created with an instance of the class IO_matrix_file.
Plot_file object constructor.
None
Create a graphic from a data file (specified by constructor). title_graph and label are used to provide the graphic title and label names in the legend. x refers to the index in the “vector<Matrix> & data” (in class IO_Matrix_file) corresponding to the x axis (ex: time), while y refers to the index in the “vector<Matrix> & data” corresponding to the y axis (ex: joints positions). x_start, y_start and y_end specify which rows of data to use.
Status, as a short int.
This function generates a plot using a range (start_y, end_y) or a selection of columns (data_select) of the ydtata while setting the titles and labels.
None