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. More... | |
void | push_import (const matplotlib::Import &import) |
Add a new Python import to the script. More... | |
std::ostream & | print (std::ostream &) const |
Display the matplotlib script on the specified output stream. More... | |
Matplotlib & | operator<< (matplotlib::Command) |
Matplotlib & | operator<< (matplotlib::Import) |
void | clear () |
Clear the vectors of imports and commands. More... | |
bool & | withHeader () |
Whether to print the header (imports). More... | |
bool | withHeader () const |
Whether to print the header (imports). More... | |
std::pair< int, int > & | multiplot () |
Plots layout. More... | |
std::pair< int, int > | multiplot () const |
Plots layout. {1,1} if unspecified. More... | |
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. More... | |
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. More... | |
void | resetImports () |
Reset imports to initial values. More... | |
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 | ( | ) |
|
explicitprotected |
Default constructor can not be called directly.
Use of the named constructor (see static methods) to instantiate this class.
References resetImports().
void roboptim::visualization::Matplotlib::clear | ( | ) |
Clear the vectors of imports and commands.
References resetImports().
|
inlinestatic |
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<<().
|
protected |
Reset imports to initial values.
Referenced by clear(), and Matplotlib().
bool & roboptim::visualization::Matplotlib::withHeader | ( | ) |
Whether to print the header (imports).
Referenced by print().
bool roboptim::visualization::Matplotlib::withHeader | ( | ) | const |
Whether to print the header (imports).