openCARP
Doxygen code documentation for the open cardiac electrophysiology simulator openCARP
Public Member Functions | List of all members
asciiPlotter Class Reference

#include <asciiPlotter.hpp>

Collaboration diagram for asciiPlotter:

Public Member Functions

 asciiPlotter ()
 empty constructor More...
 
 asciiPlotter (const unsigned int rows, const unsigned int cols)
 
void setSize (const unsigned int rows, const unsigned int cols)
 set canvas size More...
 
template<class V >
void add_graph (const std::vector< V > &func, char c)
 
template<class V >
void add_graph (const std::vector< V > &x, const std::vector< V > &y, char c)
 
void print ()
 print the plot on stdout More...
 
template<class V >
void set_xrange (const std::vector< V > &x)
 set x range according to min/max of the given vector More...
 
template<class V >
void set_xrange (V min, V max)
 set x range More...
 
template<class V >
void set_yrange (const std::vector< V > &func)
 set y range according to min/max of the given function More...
 
template<class V >
void set_yrange (V min, V max)
 set y range More...
 

Detailed Description

The asciiPlotter class plots vectors of function values using ascii characters on stdout.

Definition at line 69 of file asciiPlotter.hpp.

Constructor & Destructor Documentation

◆ asciiPlotter() [1/2]

asciiPlotter::asciiPlotter ( )
inline

empty constructor

Definition at line 159 of file asciiPlotter.hpp.

◆ asciiPlotter() [2/2]

asciiPlotter::asciiPlotter ( const unsigned int  rows,
const unsigned int  cols 
)
inline

main constructor

also sets the size of the canvas.

Definition at line 173 of file asciiPlotter.hpp.

Member Function Documentation

◆ add_graph() [1/2]

template<class V >
void asciiPlotter::add_graph ( const std::vector< V > &  func,
char  c 
)
inline

add an additional graph to the plot

x values are autogenerated as [0, func.size()]

Parameters
funcvector of function values to draw
ccharacter to use for drawing the function

Definition at line 198 of file asciiPlotter.hpp.

Here is the caller graph for this function:

◆ add_graph() [2/2]

template<class V >
void asciiPlotter::add_graph ( const std::vector< V > &  x,
const std::vector< V > &  y,
char  c 
)
inline

add an additional graph to the plot

Parameters
xvector with x values of the function to draw
yvector with y values of the function to draw
ccharacter to use for drawing the function

Definition at line 217 of file asciiPlotter.hpp.

◆ print()

void asciiPlotter::print ( )
inline

print the plot on stdout

Definition at line 229 of file asciiPlotter.hpp.

Here is the caller graph for this function:

◆ set_xrange() [1/2]

template<class V >
void asciiPlotter::set_xrange ( const std::vector< V > &  x)
inline

set x range according to min/max of the given vector

Definition at line 243 of file asciiPlotter.hpp.

Here is the caller graph for this function:

◆ set_xrange() [2/2]

template<class V >
void asciiPlotter::set_xrange ( min,
max 
)
inline

set x range

Definition at line 249 of file asciiPlotter.hpp.

◆ set_yrange() [1/2]

template<class V >
void asciiPlotter::set_yrange ( const std::vector< V > &  func)
inline

set y range according to min/max of the given function

Definition at line 258 of file asciiPlotter.hpp.

Here is the caller graph for this function:

◆ set_yrange() [2/2]

template<class V >
void asciiPlotter::set_yrange ( min,
max 
)
inline

set y range

Definition at line 264 of file asciiPlotter.hpp.

◆ setSize()

void asciiPlotter::setSize ( const unsigned int  rows,
const unsigned int  cols 
)
inline

set canvas size

Definition at line 181 of file asciiPlotter.hpp.

Here is the caller graph for this function:

The documentation for this class was generated from the following file: