linbox
PlotGraph Class Reference

The graph (2D). More...

#include <benchmark.h>

Public Member Functions

void setData (PlotData &data)
 Sets a new data structure.
 
PlotDatarefData (PlotData &data)
 Gets the data.
 
void setStyle (PlotStyle &style)
 Sets a new style structure.
 
PlotStylerefStyle (PlotStyle &style)
 Gets the style.
 
PlotStylerefStyle ()
 
void sortSeries ()
 
void unique ()
 
 PlotGraph (PlotData &data, PlotStyle &style)
 Constructor for the PlotGraph class.
 
void setOutFilename (const std::string &filename)
 sets the ouput file name.
 
const std::string & getUsingSeries ()
 
std::string getPlotCommand (const std::string &File)
 Gets the plot command line.
 
void print (Tag::Printer pt=Tag::Printer::xml)
 
void save ()
 
void load (const std::string &filename)
 

Detailed Description

The graph (2D).

This class joins a PlotStyle and a PlotData to build up a graph. A filename should be provided as well, indicating where the output graph and scripts will be generated.

Warning
the filename will get a random suffix before the extension so as not to overwrite files "par inadvertance".
don't name anything else than a folder "data" in your working directory. You've been warned.
Todo
make depend on PlotStyle (that owns data)
Todo
use getUsingSeries in latex/html/csv/xml

Constructor & Destructor Documentation

◆ PlotGraph()

PlotGraph ( PlotData & data,
PlotStyle & style )

Constructor for the PlotGraph class.

Plots a series of data according to a style.

Parameters
datadata to be plot, will be processed by the style
stylesets parameters to gnuplot to achieve a nice plot.

Member Function Documentation

◆ setData()

void setData ( PlotData & data)

Sets a new data structure.

Parameters
dataa reference to a PlotData class.

◆ refData()

PlotData & refData ( PlotData & data)

Gets the data.

Parameters
[in,out]dataa reference to a PlotData class.

◆ setStyle()

void setStyle ( PlotStyle & style)

Sets a new style structure.

Parameters
stylea reference to a PlotStyle class.

◆ refStyle() [1/2]

PlotStyle & refStyle ( PlotStyle & style)

Gets the style.

Parameters
[in,out]stylea reference to a PlotStyle class.

◆ refStyle() [2/2]

PlotStyle & refStyle ( )
inline

◆ sortSeries()

void sortSeries ( )

◆ unique()

void unique ( )

◆ setOutFilename()

void setOutFilename ( const std::string & filename)

sets the ouput file name.

All output is put in a "data" subfolder.

Warning
Since no file is overwritten, this directory can rapidly get very populated.

◆ getUsingSeries()

const std::string & getUsingSeries ( )

◆ getPlotCommand()

std::string getPlotCommand ( const std::string & File)

Gets the plot command line.

Parameters
Filethe name of/path to the data file (with extension)
Returns
a gnuplot "plot" command stream.

◆ print()

void print ( Tag::Printer pt = Tag::Printer::xml)

◆ save()

void save ( )

◆ load()

void load ( const std::string & filename)

The documentation for this class was generated from the following files: