mimas::gnuplot Class Reference

#include <gnuplot.h>

Inheritance diagram for mimas::gnuplot:

Inheritance graph
[legend]
Collaboration diagram for mimas::gnuplot:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 gnuplot (image< rgba< unsigned char > > &_img, int _width, int _height, int _timeout=3) throw (mimasexception)
 Constructor.
virtual ~gnuplot (void)
 Destructor.
void finish (void) throw (mimasexception)
 Render plot to image.
std::string getScript (void) const
 Get current script.
template<typename T>
std::ostream & operator<< (const T &t)
 Append something to the gnuplot script.
std::ostream & operator<< (std::ostream &(*__pf)(std::ostream &))
 Append io-manipulator to the gnuplot script.
template<typename T>
void plot (const boost::numeric::ublas::vector< T > &vec)
 Plot vector - like in Octave.
template<typename T>
void plot (const boost::numeric::ublas::matrix< T > &mat)
 Plot matrix - like in Octave.
template<typename T>
void plot (const boost::numeric::ublas::matrix< T > &mat, int xcol, int ycol, const std::string &style="points", int type=1, int size=1) throw (mimasexception)
 Plotting of xcol against ycol.
template<typename T>
void plot_histogram (const std::vector< T > &vec, std::string title="")
 Histogram ploting of a vector.
template<typename T>
void plot (const std::vector< T > &vector, std::string title="")
 To visualize the content of a std::vector.
template<typename T>
void plotImageProfile (const image< T > &im)
 plot an image<int> profile
template<typename T>
void plotImageProfile2 (const image< T > &im, std::string title="")
 plot an image<int> profile
void setMultiPlot (bool multiplot)
 set or unset multiplot
void setLineTitle (const char *title,...)
 Set line titles for use with plotxy.
void unsetLineTitle (void)
 Unset line titles.
template<typename T>
void plotxy (const boost::numeric::ublas::matrix< T > &mat, int xcol, int ycol,...) throw (mimasexception)
 plotting of x and single or multple y column pairs.

Static Protected Member Functions

static void alarmHandler (int signal)

Protected Attributes

image< rgba< unsigned char > > * img
 The plot will be rendered to this image.
int timeout
 Kill 'gnuplot' after so many seconds.
bool finished
 Boolean indicating, wether finish was called already.
int pipes [2]
 Pipes to communicate with 'gnuplot'.
int width
int height
std::ostringstream program
 Stream to temporarily store gnuplot script.
std::vector< std::string > lineTitles
 List of titles used by plotxy.

Static Protected Attributes

static pid_t pid
 Process-ID of 'gnuplot'.

Detailed Description

Definition at line 17 of file gnuplot.h.


Constructor & Destructor Documentation

mimas::gnuplot::gnuplot ( image< rgba< unsigned char > > &  _img,
int  _width,
int  _height,
int  _timeout = 3 
) throw (mimasexception)

Constructor.

virtual mimas::gnuplot::~gnuplot ( void   )  [virtual]

Destructor.

Will call finish(), if it was not called already.


Member Function Documentation

void mimas::gnuplot::finish ( void   )  throw (mimasexception)

Render plot to image.

std::string mimas::gnuplot::getScript ( void   )  const [inline]

Get current script.

You can request the script at it's current state (without the terminal-command).

Definition at line 31 of file gnuplot.h.

References program.

template<typename T>
std::ostream& mimas::gnuplot::operator<< ( const T &  t  )  [inline]

Append something to the gnuplot script.

Definition at line 34 of file gnuplot.h.

References program.

std::ostream& mimas::gnuplot::operator<< ( std::ostream &(*)(std::ostream &)  __pf  )  [inline]

Append io-manipulator to the gnuplot script.

Definition at line 36 of file gnuplot.h.

References program.

template<typename T>
void mimas::gnuplot::plot ( const boost::numeric::ublas::vector< T > &  vec  ) 

Plot vector - like in Octave.

Definition at line 153 of file gnuplot.h.

template<typename T>
void mimas::gnuplot::plot ( const boost::numeric::ublas::matrix< T > &  mat  ) 

Plot matrix - like in Octave.

Definition at line 163 of file gnuplot.h.

template<typename T>
void mimas::gnuplot::plot ( const boost::numeric::ublas::matrix< T > &  mat,
int  xcol,
int  ycol,
const std::string &  style = "points",
int  type = 1,
int  size = 1 
) throw (mimasexception)

Plotting of xcol against ycol.

Columns are indexed from 0. style is either "line" or "point". type is an integer which specifies the type of line or point (refer to gnuplot package). size is the point or line size. Use setMultiPlot to overlay plots.

Definition at line 179 of file gnuplot.h.

template<typename T>
void mimas::gnuplot::plot_histogram ( const std::vector< T > &  vec,
std::string  title = "" 
)

Histogram ploting of a vector.

Definition at line 107 of file gnuplot.h.

template<typename T>
void mimas::gnuplot::plot ( const std::vector< T > &  vector,
std::string  title = "" 
)

To visualize the content of a std::vector.

Definition at line 130 of file gnuplot.h.

template<typename T>
void mimas::gnuplot::plotImageProfile ( const image< T > &  im  ) 

plot an image<int> profile

Definition at line 277 of file gnuplot.h.

template<typename T>
void mimas::gnuplot::plotImageProfile2 ( const image< T > &  im,
std::string  title = "" 
)

plot an image<int> profile

Definition at line 299 of file gnuplot.h.

void mimas::gnuplot::setMultiPlot ( bool  multiplot  ) 

set or unset multiplot

void mimas::gnuplot::setLineTitle ( const char *  title,
  ... 
)

Set line titles for use with plotxy.

void mimas::gnuplot::unsetLineTitle ( void   ) 

Unset line titles.

template<typename T>
void mimas::gnuplot::plotxy ( const boost::numeric::ublas::matrix< T > &  mat,
int  xcol,
int  ycol,
  ... 
) throw (mimasexception)

plotting of x and single or multple y column pairs.

List of y columns must be terminated by NULL or it will lead to indiscriminate behaviour. Columns are indexed from 0.

Definition at line 202 of file gnuplot.h.

static void mimas::gnuplot::alarmHandler ( int  signal  )  [static, protected]


Member Data Documentation

image< rgba< unsigned char > >* mimas::gnuplot::img [protected]

The plot will be rendered to this image.

Definition at line 84 of file gnuplot.h.

int mimas::gnuplot::timeout [protected]

Kill 'gnuplot' after so many seconds.

Definition at line 86 of file gnuplot.h.

bool mimas::gnuplot::finished [protected]

Boolean indicating, wether finish was called already.

Definition at line 88 of file gnuplot.h.

pid_t mimas::gnuplot::pid [static, protected]

Process-ID of 'gnuplot'.

Definition at line 90 of file gnuplot.h.

int mimas::gnuplot::pipes[2] [protected]

Pipes to communicate with 'gnuplot'.

Definition at line 92 of file gnuplot.h.

int mimas::gnuplot::width [protected]

Definition at line 94 of file gnuplot.h.

int mimas::gnuplot::height [protected]

Definition at line 96 of file gnuplot.h.

std::ostringstream mimas::gnuplot::program [protected]

Stream to temporarily store gnuplot script.

Definition at line 98 of file gnuplot.h.

Referenced by getScript(), and operator<<().

std::vector< std::string > mimas::gnuplot::lineTitles [protected]

List of titles used by plotxy.

Definition at line 100 of file gnuplot.h.


The documentation for this class was generated from the following file:
[GNU/Linux] [Qt] [Mesa] [STL] [Lapack] [Boost] [Magick++] [Xalan-C and Xerces-C] [doxygen] [graphviz] [FFTW] [popt] [xine] [Gnuplot] [gnu-arch] [gcc] [gstreamer] [autoconf/automake/make] [freshmeat.net] [opensource.org] [sourceforge.net] [MMVL]
mimas 2.1 - Copyright Mon Oct 30 11:31:27 2006, Bala Amavasai, Stuart Meikle, Arul Selvan, Fabio Caparrelli, Jan Wedekind, Manuel Boissenin, ...