matplotlib script More...
#include <roboptim/core/visualization/matplotlib.hh>
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. | |
Matplotlib & | operator<< (matplotlib::Command) |
Matplotlib & | operator<< (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. |
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.
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().
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.
with_header | whether to print the header or not |
std::pair< int, int > & roboptim::visualization::Matplotlib::multiplot | ( | ) |
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.
o | output stream used for display |
References multiplot(), and withHeader().
Referenced by roboptim::visualization::operator<<().
void roboptim::visualization::Matplotlib::push_command | ( | const matplotlib::Command & | cmd | ) |
Add a new matplotlib command to the script.
cmd | command that will be pushed |
Referenced by operator<<(), and roboptim::visualization::operator<<().
void roboptim::visualization::Matplotlib::push_import | ( | const matplotlib::Import & | import | ) |
Add a new Python import to the script.
import | package to import |
Referenced by operator<<().
void roboptim::visualization::Matplotlib::resetImports | ( | ) | [protected] |
Reset imports to initial values.
Referenced by clear(), and Matplotlib().
bool roboptim::visualization::Matplotlib::withHeader | ( | ) | const |
Whether to print the header (imports).