roboptim::visualization::Matplotlib Class Reference

matplotlib script More...

#include <roboptim/core/visualization/matplotlib.hh>

List of all members.

Public Member Functions

 ~Matplotlib ()
void push_command (const matplotlib::Command &cmd)
 Add a new matplotlib command to the script.
void push_import (const matplotlib::Import &import)
 Add a new Python import to the script.
std::ostream & print (std::ostream &) const
 Display the matplotlib script on the specified output stream.
Matplotliboperator<< (matplotlib::Command)
Matplotliboperator<< (matplotlib::Import)
void clear ()
 Clear the vectors of imports and commands.
bool & withHeader ()
 Whether to print the header (imports).
bool withHeader () const
 Whether to print the header (imports).
std::pair< int, int > & multiplot ()
 Plots layout.
std::pair< int, int > multiplot () const
 Plots layout. {1,1} if unspecified.

Static Public Member Functions

static Matplotlib make_matplotlib (std::pair< int, int > multiplot=std::make_pair(1, 1), bool with_header=true)
 Instanciate a matplotlib without setting a term.

Protected Member Functions

 Matplotlib (std::pair< int, int > multiplot=std::make_pair(1, 1), bool with_header=true)
 Default constructor can not be called directly.
void resetImports ()
 Reset imports to initial values.

Detailed Description

matplotlib script

This class gathers matplotlib commands to build a complete matplotlib script. matplotlib commands can be inserted through this object through the << operator and this object can be put into an output stream using the << operator.

Examples:
visualization-matplotlib-function.cc, and visualization-matplotlib-simple.cc.

Constructor & Destructor Documentation

roboptim::visualization::Matplotlib::Matplotlib ( std::pair< int, int >  multiplot = std::make_pair(1, 1),
bool  with_header = true 
) [explicit, protected]

Default constructor can not be called directly.

Use of the named constructor (see static methods) to instantiate this class.

References resetImports().


Member Function Documentation

Clear the vectors of imports and commands.

References resetImports().

static Matplotlib roboptim::visualization::Matplotlib::make_matplotlib ( std::pair< int, int >  multiplot = std::make_pair(1, 1),
bool  with_header = true 
) [inline, static]

Instanciate a matplotlib without setting a term.

Parameters:
with_headerwhether to print the header or not
Returns:
matplotlib instance

Plots layout.

{1,1} if unspecified.

Returns:
Reference to multiplot_

Referenced by print().

std::pair< int, int > roboptim::visualization::Matplotlib::multiplot ( ) const

Plots layout. {1,1} if unspecified.

Matplotlib & roboptim::visualization::Matplotlib::operator<< ( matplotlib::Command  cmd)

References push_command().

Matplotlib & roboptim::visualization::Matplotlib::operator<< ( matplotlib::Import  import)

References push_import().

std::ostream & roboptim::visualization::Matplotlib::print ( std::ostream &  o) const

Display the matplotlib script on the specified output stream.

Parameters:
ooutput stream used for display
Returns:
output stream

References multiplot(), and withHeader().

Referenced by roboptim::visualization::operator<<().

Add a new matplotlib command to the script.

Parameters:
cmdcommand that will be pushed

Referenced by operator<<(), and roboptim::visualization::operator<<().

Add a new Python import to the script.

Parameters:
importpackage to import

Referenced by operator<<().

Reset imports to initial values.

Referenced by clear(), and Matplotlib().

Whether to print the header (imports).

Returns:
Reference to withHeader_.

Referenced by print().

Whether to print the header (imports).

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines