#include <gnuplot.h>
Inheritance diagram for mimas::gnuplot:
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'. |
Definition at line 17 of file gnuplot.h.
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.
void mimas::gnuplot::finish | ( | void | ) | throw (mimasexception) |
Render plot to image.
std::string mimas::gnuplot::getScript | ( | void | ) | const [inline] |
std::ostream& mimas::gnuplot::operator<< | ( | const T & | t | ) | [inline] |
std::ostream& mimas::gnuplot::operator<< | ( | std::ostream &(*)(std::ostream &) | __pf | ) | [inline] |
void mimas::gnuplot::plot | ( | const boost::numeric::ublas::vector< T > & | vec | ) |
void mimas::gnuplot::plot | ( | const boost::numeric::ublas::matrix< T > & | mat | ) |
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) |
void mimas::gnuplot::plot_histogram | ( | const std::vector< T > & | vec, | |
std::string | title = "" | |||
) |
void mimas::gnuplot::plot | ( | const std::vector< T > & | vector, | |
std::string | title = "" | |||
) |
void mimas::gnuplot::plotImageProfile | ( | const image< T > & | im | ) |
void mimas::gnuplot::plotImageProfile2 | ( | const image< T > & | im, | |
std::string | title = "" | |||
) |
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.
void mimas::gnuplot::plotxy | ( | const boost::numeric::ublas::matrix< T > & | mat, | |
int | xcol, | |||
int | ycol, | |||
... | ||||
) | throw (mimasexception) |
static void mimas::gnuplot::alarmHandler | ( | int | signal | ) | [static, protected] |
image< rgba< unsigned char > >* mimas::gnuplot::img [protected] |
int mimas::gnuplot::timeout [protected] |
bool mimas::gnuplot::finished [protected] |
pid_t mimas::gnuplot::pid [static, protected] |
int mimas::gnuplot::pipes[2] [protected] |
int mimas::gnuplot::width [protected] |
int mimas::gnuplot::height [protected] |
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] |