linbox
Data Structures | Public Member Functions
PlotStyle Class Reference

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

Detailed Description

Represents a table of values to plot (2D).

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

make depend on PlotData

Todo:
setUsingSeries(const svector_t &)

Constructor & Destructor Documentation

◆ PlotStyle()

PlotStyle ( )

Constructor.

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

Member Function Documentation

◆ setTitle()

void setTitle ( const std::string &  titre,
const std::string &  titre_y,
const std::string &  titre_x 
)

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)

◆ getTitle()

std::string getTitle ( ) const

Gets the title of the graph.

Returns
a gnuplot command to set the title of the graph.

◆ getTitleX()

std::string getTitleX ( ) const

Gets the title of points abscissa.

Returns
a gnuplot command to set the title of the abscissa.

◆ getTitleY()

std::string getTitleY ( ) const

Gets the title of the series.

Returns
a gnuplot command to set the title of the ordinate (series).

◆ getRawTitle()

std::string getRawTitle ( int  index = 0) const

get the title string.

Parameters
indexcan be (0,1,2)

◆ setTerm()

void setTerm ( enum Term::Type  term)

Sets the output format.

See also
TermType
Parameters
termtype

◆ getTerm()

std::string getTerm ( ) const

Gets the output format.

Returns
string for setting the expected output format in gnuplot.
Warning
noenhanced allows underscores while enhanced does subscripts. if we add a (no) enhanced option, we'll have to add a safeFormat(std::string) that replaces _ with _ . This is tricky and can be done at "post production" stage :-)

◆ getExt()

std::string getExt ( ) const

Gets the graph output extension.

By default, this is ".eps".

Returns
a string for this extension, including the sepatating dot.

◆ setKeyPos()

void setKeyPos ( const std::string &  keypos)

sets the legend position.

Parameters
keyposthe arguments to key (where the legend should be put) can be : set key {on|off} {default} {{inside | outside} | {lmargin | rmargin | tmargin | bmargin} | {at <position>}} {left | right | center} {top | bottom | center} {vertical | horizontal} {Left | Right} {{no}reverse} {{no}invert} {samplen <sample_length>} {spacing <vertical_spacing>} {width <width_increment>} {height <height_increment>} {{no}autotitle {columnheader}} {title "<text>"} {{no}enhanced} {{no}box { {linestyle | ls <line_style>} | {linetype | lt <line_type>} {linewidth | lw <line_width>}}}

◆ getKeyPos()

std::string getKeyPos ( ) const

Gets the legend position.

by default, it is "under".

◆ setXtics()

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

sets the position of the labels on the X absciss.

Parameters
opt
moremore stuff

◆ getXtics()

const std::string & getXtics ( ) const

Gets the legend position.

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

◆ getOutput()

std::string getOutput ( const std::string &  basnam) const

Gets the name of the output graph.

Parameters
basnamthe raw name for the output.
Returns
basnam+extenstion.

◆ setPlotType()

void setPlotType ( enum Plot::Type  type)

Sets the type of plot.

Parameters
typethe type.
See also
PlotType

◆ setLineType()

void setLineType ( enum Line::Type  type)

Sets the way dots are linked.

See also
LineType
Parameters
typetype

◆ getPlotType()

std::string getPlotType ( const std::string &  extraargs = "")

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

◆ addPlotType()

void addPlotType ( const std::string &  style)

adds some style line to the graph.

This is very user-tweakable !!

Parameters
stylea style line for gnuplot as a gnuplot command.

◆ setUsingSeries() [1/3]

void setUsingSeries ( size_t  col,
const std::string &  moreargs = "" 
)

tells which columns to use.

Parameters
cola column to use.
moreargsmore stuff

◆ addUsingSeries() [1/3]

void addUsingSeries ( size_t  col,
const std::string &  moreargs = "" 
)

adds a column to use

Parameters
cola column to use.
moreargsmore stuff
Precondition
usingcols is not empty, ie setUsingSeries has already been called.

◆ setUsingSeries() [2/3]

void setUsingSeries ( std::list< size_t >  cols,
const std::string &  moreargs = "" 
)

tells which columns to use.

Parameters
colsa list of column to use.
moreargsmore stuff

◆ addUsingSeries() [2/3]

void addUsingSeries ( std::list< size_t >  cols,
const std::string &  moreargs = "" 
)

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.

◆ setUsingSeries() [3/3]

void setUsingSeries ( std::pair< size_t, size_t >  cols,
const std::string &  moreargs = "" 
)

tells which columns to use.

Parameters
colsall colums between cols.first and cols.second (included) will be used.
moreargsmore stuff

◆ addUsingSeries() [3/3]

void addUsingSeries ( std::pair< size_t, size_t >  cols,
const std::string &  moreargs = "" 
)

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.

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