LTL
2.0.x
|
Inherits fdostream.
Public Member Functions | |
Gnuplot (const std::string cmd="") | |
~Gnuplot () | |
void | getMouse (double &mx, double &my, int &mb) |
template<class T > | |
Gnuplot & | send_iter (T p, const T &last) |
template<class T > | |
Gnuplot & | send (const ltl::MArray< T, 1 > &A) |
template<class T1 , class T2 > | |
Gnuplot & | send (const ltl::MArray< T1, 1 > &X, const ltl::MArray< T2, 1 > &Y) |
template<class T > | |
Gnuplot & | send (const ltl::MArray< T, 2 > &A) |
template<class T > | |
Gnuplot & | sendAsImage (const ltl::MArray< T, 2 > &A) |
void | interactive (const string &pname) |
Protected Member Functions | |
template<class T > | |
Gnuplot & | send (const T &x) |
template<class T , int N> | |
void | sendEntry (const ltl::FVector< T, N > &v) |
template<class T , int N> | |
void | sendEntry (const ltl::FixedVector< T, N > &v) |
template<class T > | |
void | sendEntry (const T v) |
template<class T , class U > | |
void | sendEntry (const std::pair< T, U > &v) |
void | allocReader () |
Protected Attributes | |
FILE * | pout |
std::string | pty_fn |
FILE * | pty_fh |
int | master_fd |
int | slave_fd |
bool | debug_messages |
Gnuplot interface for MArrays
and FVectors
Simple interface to call gnuplot and send MArray
and FVector
objects. An instance of a Gnuplot
class encapsulates a pipe into gnuplot's stdin. It exports a stream interface to the user, so that any gnuplot command can be sent via operator<<
. For convenience, functions handling the loops over elements and the necessary formatting to plot elements of 1-D MArray
against index number, two 1-D MArray
against each other, 2-D MArray
surfaces, and elements of any stl-iterator compatible container are provided.
The follwing example code should be self-explanatory:
Gnuplot::send()
works with MArrays
up to dimension 2, FVectors
. For stdlib containers use send
with any valid iterator range, i.e. send
(v.begin(),v.end())
Gnuplot
inherits from std::ostream
, so any gnuplot commands and data can be sent to Gnuplot
via standard streamio operations, operator<<
, setprecision()
, etc.
ltl::Gnuplot::Gnuplot | ( | const std::string | cmd = "" | ) |
Construct with command to launch gnuplot. This will call gnuplot and open a pipe.
ltl::Gnuplot::~Gnuplot | ( | ) |
Wait for mouse event in gnuplot window and return corrdinates and button
Gnuplot & ltl::Gnuplot::send_iter | ( | T | p, |
const T & | last | ||
) |
Any iterator
range
References send().
Gnuplot & ltl::Gnuplot::send | ( | const ltl::MArray< T, 1 > & | A | ) |
1-Dimensional MArray
1-Dimensional MArray
Will be plotted against index number.
References ltl::indexPosInt(), and ltl::MArray< T, N >::shape().
Referenced by send(), and send_iter().
Gnuplot & ltl::Gnuplot::send | ( | const ltl::MArray< T1, 1 > & | X, |
const ltl::MArray< T2, 1 > & | Y | ||
) |
Plot 2 MArrays
against each other
References ltl::MArray< T, N >::maxIndex(), ltl::MArray< T, N >::minIndex(), and send().
Gnuplot & ltl::Gnuplot::send | ( | const ltl::MArray< T, 2 > & | A | ) |
2-Dimensional MArray
References ltl::MArray< T, N >::maxIndex(), ltl::MArray< T, N >::minIndex(), and send().
Gnuplot & ltl::Gnuplot::sendAsImage | ( | const ltl::MArray< T, 2 > & | A | ) |
2-Dimensional MArray
to be used with "plot '-' matrix with image" Note: T could be either a scalar or a blitz::TinyVector.
References ltl::MArray< T, N >::maxIndex(), and ltl::MArray< T, N >::minIndex().
void ltl::Gnuplot::interactive | ( | const string & | pname | ) |
|
inlineprotected |
Handles container elements
References sendEntry().
|
inlineprotected |
Referenced by send(), and sendEntry().
|
inlineprotected |
References sendEntry().
|
inlineprotected |
|
inlineprotected |
References sendEntry().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |