linbox
Data Structures | Public Member Functions
PlotStyle Class Reference

Represents a table of values to plot. More...

#include <benchmark.h>

Data Structures

struct  Plot
 What style of graphic : histogram ? graph ? More...
 
struct  Term
 What format the plot should be in? More...
 

Public Member Functions

 PlotStyle ()
 Constructor.
 
void setTitle (std::string titre, std::string titre_y, std::string titre_x)
 sets the titles in the graph.
 
std::string getTitle ()
 Gets the title of the graph.
 
std::string getTitleX ()
 Gets the title of points abscissa.
 
std::string getTitleY ()
 Gets the title of the series.
 
std::string getRawTitle (int index=0)
 get the title string.
 
void setTerm (enum Term::Type term)
 Sets the output format.
 
std::string getTerm ()
 Gets the output format.
 
std::string getExt ()
 Gets the graph output extension.
 
void setKeyPos (std::string keypos)
 sets the legend position.
 
std::string getKeyPos ()
 Gets the legend position.
 
void setXtics (enum Options::Type opt, std::string more="")
 sets the position of the labels on the X absciss.
 
std::string getXtics ()
 Gets the legend position.
 
std::string getOutput (std::string basnam)
 Gets the name of the output graph.
 
void setPlotType (enum Plot::Type type)
 Sets the type of plot.
 
void setLineType (enum Line::Type type)
 Sets the way dots are linked.
 
std::string getPlotType ()
 Gets the type of plot.
 
void addPlotType (std::string style)
 adds some style line to the graph.
 
void setUsingSeries (index_t col, std::string moreargs="")
 tells which columns to use.
 
void addUsingSeries (index_t col, std::string moreargs="")
 adds a column to use
 
void setUsingSeries (std::list< index_t > cols, std::string moreargs="")
 tells which columns to use.
 
void addUsingSeries (std::list< index_t > cols, std::string moreargs="")
 adds a set of columns to use.
 
void setUsingSeries (std::pair< index_t, index_t > cols, std::string moreargs="")
 tells which columns to use.
 
void addUsingSeries (std::pair< index_t, index_t > cols, std::string moreargs="")
 adds contiguous columns to use.
 
std::string getPlotCommand (std::string File)
 Gets the plot command line.
 

Detailed Description

Represents a table of values to plot.

  list of values are reprensented by vectors.  the table is a vector
  of these vectors.
Warning
NaN, inf are used as missing data. More genenally we could store data in strings.
Todo:
Allow for 'speed up against col X' style

Constructor & Destructor Documentation

PlotStyle ( )
inline

Constructor.

By default, creates an histogram representing the data in an eps plot.

Member Function Documentation

void setTitle ( std::string  titre,
std::string  titre_y,
std::string  titre_x 
)
inline

sets the titles in the graph.

Parameters
titreTitle of the graph
titre_yTitle of the y-axis (series)
titre_xTitle of the x-axis (data points)
std::string getTitle ( )
inline

Gets the title of the graph.

Returns
a gnuplot command to set the title of the graph.
std::string getTitleX ( )
inline

Gets the title of points abscissa.

Returns
a gnuplot command to set the title of the abscissa.
std::string getTitleY ( )
inline

Gets the title of the series.

Returns
a gnuplot command to set the title of the ordinate (series).
std::string getRawTitle ( int  index = 0)
inline

get the title string.

Parameters
indexcan be (0,1,2)
void setTerm ( enum Term::Type  term)
inline

Sets the output format.

See Also
TermType
Parameters
termtype
std::string getTerm ( )
inline

Gets the output format.

Returns
string for setting the expected output format in gnuplot.
std::string getExt ( )
inline

Gets the graph output extension.

      By default, this is ".eps".
Returns
a string for this extension, including the sepatating dot.
void setKeyPos ( std::string  keypos)
inline

sets the legend position.

Parameters
keyposthe arguments to key (where the legend should be put) can be : inside, outside,...
std::string getKeyPos ( )
inline

Gets the legend position.

by default, it is "under".

void setXtics ( enum Options::Type  opt,
std::string  more = "" 
)
inline

sets the position of the labels on the X absciss.

Parameters
opt
moremore stuff
std::string getXtics ( )
inline

Gets the legend position.

by default, it is 45° inclined (use in on long tics legends).

std::string getOutput ( std::string  basnam)
inline

Gets the name of the output graph.

Parameters
basnamthe raw name for the output.
Returns
basnam+extenstion.
void setPlotType ( enum Plot::Type  type)
inline

Sets the type of plot.

Parameters
typethe type.
See Also
PlotType
void setLineType ( enum Line::Type  type)
inline

Sets the way dots are linked.

See Also
LineType
Parameters
typetype
std::string getPlotType ( )
inline

Gets the type of plot.

      default is histogram, or if graph is supplied, then the default is linespoints.
      Can be totally customized.
Returns
a string for gnuplot to set the plot type.
See Also
PlotType
void addPlotType ( std::string  style)
inline

adds some style line to the graph.

      This is very user-tweakable !!
Parameters
stylea style line for gnuplot as a gnuplot command.
void setUsingSeries ( index_t  col,
std::string  moreargs = "" 
)
inline

tells which columns to use.

Parameters
cola column to use.
moreargsmore stuff
void addUsingSeries ( index_t  col,
std::string  moreargs = "" 
)
inline

adds a column to use

Parameters
cola column to use.
moreargsmore stuff
Precondition
usingcols is not empty, ie setUsingSeries has already been called.
void setUsingSeries ( std::list< index_t >  cols,
std::string  moreargs = "" 
)
inline

tells which columns to use.

Parameters
colsa list of column to use.
moreargsmore stuff
void addUsingSeries ( std::list< index_t >  cols,
std::string  moreargs = "" 
)
inline

adds a set of columns to use.

Parameters
colsa list of column to use.
moreargsmore stuff
Precondition
usingcols is not empty, ie setUsingSeries has already been called.
void setUsingSeries ( std::pair< index_t, index_t >  cols,
std::string  moreargs = "" 
)
inline

tells which columns to use.

Parameters
colsall colums between cols.first and cols.second will be used.
moreargsmore stuff
void addUsingSeries ( std::pair< index_t, index_t >  cols,
std::string  moreargs = "" 
)
inline

adds contiguous columns to use.

Parameters
colsall colums between cols.first and cols.second will be used.
moreargsmore stuff
Precondition
usingcols is not empty, ie setUsingSeries has already been called.
std::string getPlotCommand ( std::string  File)
inline

Gets the plot command line.

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

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