Developer Documentation
Gnuplot Class Reference

#include <OpenFlipper/libs_required/OpenMesh/src/OpenMesh/Tools/Utils/Gnuplot.hh>

Public Member Functions

Constructors
 Gnuplot ()
 Default constructor. More...
 
 Gnuplot (const string &_style)
 Set a style during construction. More...
 
 Gnuplot (const string &_title, const string &_style, const string &_xlabel, const string &_ylabel, const vector< double > &_x, const vector< double > &_y)
 Constructor calling plot_xy(). More...
 
 Gnuplot (const string &_title, const string &_style, const string &_xlabel, const string &_ylabel, const vector< double > &_x)
 Constructor calling plot_x(). More...
 
 ~Gnuplot ()
 Default constructor. More...
 
void cmd (const char *_cmd,...)
 Send a command to gnuplot (low-level function use by all plot functions.) More...
 
Gnuplot settings
void set_style (const string &_style)
 set line style More...
 
void set_ylabel (const string &_ylabel)
 set x axis label More...
 
void set_xlabel (const string &_xlabel)
 set x axis label More...
 
plot functions
void plot_x (const vector< double > &_x, const string &_title)
 Plot a single vector. More...
 
void plot_xy (const vector< double > &_x, const vector< double > &_y, const string &_title)
 Plot x,y pairs. More...
 
void plot_slope (double _a, double _b, const string &_title)
 
void plot_equation (const string &_equation, const string &_title)
 Plot an equation supplied as a string. More...
 
void reset_plot (void)
 If multiple plots are present it will clear the plot area. More...
 
bool is_valid (void) const
 Is Self valid? More...
 
bool is_active (void) const
 Is Self active, i.e. does it have an active plot? More...
 

Private Member Functions

bool get_program_path (const string &)
 
void init ()
 

Private Attributes

FILE * gnucmd
 
string pstyle
 
vector< string > to_delete
 
int nplots
 
bool valid
 

Static Private Attributes

static string gnuplot_executable_ = "gnuplot"
 

Detailed Description

Utility class interfacing with Gnuplot.

Note
The plot will be visible as long as the object is not destructed.
Author
Rajarshi Guha (C++ API based on the C API by Nicolas Devillard)
See also
http://ndevilla.free.fr/gnuplot/ more information.

Definition at line 92 of file Gnuplot.hh.

Constructor & Destructor Documentation

◆ Gnuplot() [1/4]

Gnuplot::Gnuplot ( void  )

Default constructor.

Definition at line 110 of file Gnuplot.cc.

◆ Gnuplot() [2/4]

Gnuplot::Gnuplot ( const string &  _style)
explicit

Set a style during construction.

Definition at line 118 of file Gnuplot.cc.

◆ Gnuplot() [3/4]

Gnuplot::Gnuplot ( const string &  _title,
const string &  _style,
const string &  _xlabel,
const string &  _ylabel,
const vector< double > &  _x,
const vector< double > &  _y 
)

Constructor calling plot_xy().

Definition at line 126 of file Gnuplot.cc.

◆ Gnuplot() [4/4]

Gnuplot::Gnuplot ( const string &  _title,
const string &  _style,
const string &  _xlabel,
const string &  _ylabel,
const vector< double > &  _x 
)

Constructor calling plot_x().

Definition at line 158 of file Gnuplot.cc.

◆ ~Gnuplot()

Gnuplot::~Gnuplot ( )

Default constructor.

Definition at line 191 of file Gnuplot.cc.

Member Function Documentation

◆ cmd()

void Gnuplot::cmd ( const char *  _cmd,
  ... 
)

Send a command to gnuplot (low-level function use by all plot functions.)

Definition at line 261 of file Gnuplot.cc.

◆ get_program_path()

bool Gnuplot::get_program_path ( const string &  pname)
private

Definition at line 207 of file Gnuplot.cc.

◆ init()

void Gnuplot::init ( void  )
private

Definition at line 486 of file Gnuplot.cc.

◆ is_active()

bool Gnuplot::is_active ( void  ) const
inline

Is Self active, i.e. does it have an active plot?

Definition at line 177 of file Gnuplot.hh.

◆ is_valid()

bool Gnuplot::is_valid ( void  ) const
inline

Is Self valid?

Definition at line 174 of file Gnuplot.hh.

◆ plot_equation()

void Gnuplot::plot_equation ( const string &  _equation,
const string &  _title 
)

Plot an equation supplied as a string.

Definition at line 328 of file Gnuplot.cc.

◆ plot_slope()

void Gnuplot::plot_slope ( double  _a,
double  _b,
const string &  _title 
)

Plot an equation of the form: y = ax + b You supply a and b

Definition at line 305 of file Gnuplot.cc.

◆ plot_x()

void Gnuplot::plot_x ( const vector< double > &  _x,
const string &  _title 
)

Plot a single vector.

Definition at line 352 of file Gnuplot.cc.

◆ plot_xy()

void Gnuplot::plot_xy ( const vector< double > &  _x,
const vector< double > &  _y,
const string &  _title 
)

Plot x,y pairs.

Definition at line 421 of file Gnuplot.cc.

◆ reset_plot()

void Gnuplot::reset_plot ( void  )

If multiple plots are present it will clear the plot area.

Definition at line 230 of file Gnuplot.cc.

◆ set_style()

void Gnuplot::set_style ( const string &  _style)

set line style

Definition at line 243 of file Gnuplot.cc.

◆ set_xlabel()

void Gnuplot::set_xlabel ( const string &  _xlabel)

set x axis label

Definition at line 290 of file Gnuplot.cc.

◆ set_ylabel()

void Gnuplot::set_ylabel ( const string &  _ylabel)

set x axis label

Definition at line 278 of file Gnuplot.cc.

Member Data Documentation

◆ gnucmd

FILE* Gnuplot::gnucmd
private

Definition at line 96 of file Gnuplot.hh.

◆ gnuplot_executable_

std::string Gnuplot::gnuplot_executable_ = "gnuplot"
staticprivate

Definition at line 104 of file Gnuplot.hh.

◆ nplots

int Gnuplot::nplots
private

Definition at line 99 of file Gnuplot.hh.

◆ pstyle

string Gnuplot::pstyle
private

Definition at line 97 of file Gnuplot.hh.

◆ to_delete

vector<string> Gnuplot::to_delete
private

Definition at line 98 of file Gnuplot.hh.

◆ valid

bool Gnuplot::valid
private

Definition at line 101 of file Gnuplot.hh.


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