Graph Class Reference

Graph is a utility class storing a simple XY graph (eg., a convergence graph). One or more data rows can be defined by calling add_row(). The actual data are added to the rows by calling add_values(). The resulting graph is saved to a file by calling save(). More...

#include <graph.h>

Inherited by GnuplotGraph, MatlabGraph, and SimpleGraph.

List of all members.

Classes

struct  Row
struct  Values

Public Member Functions

 Graph (const char *title=NULL, const char *x_axis_name=NULL, const char *y_axis_name=NULL)
void set_captions (const char *title=NULL, const char *x_axis_name=NULL, const char *y_axis_name=NULL)
void set_log_x (bool log=true)
void set_log_y (bool log=true)
void show_legend (bool show=true)
void show_grid (bool show=true)
int add_row (const char *name=NULL, const char *color="k", const char *line="-", const char *marker="")
void set_row_style (int row, const char *color="k", const char *line="-", const char *marker="")
void add_values (int row, double x, double y)
void add_values (double x, double y)
void add_values (int row, int n, double *x, double *y)
void add_values (int row, int n, double2 *xy)
virtual void save (const char *filename)=0
void save_numbered (const char *filename, int number)

Protected Member Functions

 H2D_API_USED_STL_VECTOR (Row)

Protected Attributes

std::string title
std::string xname
std::string yname
bool logx
bool logy
bool legend
bool grid
std::vector< Rowrows

Detailed Description

Graph is a utility class storing a simple XY graph (eg., a convergence graph). One or more data rows can be defined by calling add_row(). The actual data are added to the rows by calling add_values(). The resulting graph is saved to a file by calling save().

Please note that this is a base class that cannot be instantiated. Use MatlabGraph or GnuplotGraph instead.


Constructor & Destructor Documentation

Graph::Graph ( const char *  title = NULL,
const char *  x_axis_name = NULL,
const char *  y_axis_name = NULL 
)

Member Function Documentation

int Graph::add_row ( const char *  name = NULL,
const char *  color = "k",
const char *  line = "-",
const char *  marker = "" 
)
void Graph::add_values ( int  row,
int  n,
double2 xy 
)
void Graph::add_values ( int  row,
int  n,
double *  x,
double *  y 
)
void Graph::add_values ( double  x,
double  y 
)
void Graph::add_values ( int  row,
double  x,
double  y 
)
Graph::H2D_API_USED_STL_VECTOR ( Row   )  [protected]
virtual void Graph::save ( const char *  filename  )  [pure virtual]

Implemented in SimpleGraph, MatlabGraph, and GnuplotGraph.

void Graph::save_numbered ( const char *  filename,
int  number 
)
void Graph::set_captions ( const char *  title = NULL,
const char *  x_axis_name = NULL,
const char *  y_axis_name = NULL 
)
void Graph::set_log_x ( bool  log = true  )  [inline]
void Graph::set_log_y ( bool  log = true  )  [inline]
void Graph::set_row_style ( int  row,
const char *  color = "k",
const char *  line = "-",
const char *  marker = "" 
)
void Graph::show_grid ( bool  show = true  )  [inline]
void Graph::show_legend ( bool  show = true  )  [inline]

Member Data Documentation

bool Graph::grid [protected]
bool Graph::legend [protected]
bool Graph::logx [protected]
bool Graph::logy [protected]
std::vector<Row> Graph::rows [protected]
std::string Graph::title [protected]
std::string Graph::xname [protected]
std::string Graph::yname [protected]

The documentation for this class was generated from the following files:
Generated on Sat Jun 5 15:17:43 2010 for Hermes2D Library: Real Version by  doxygen 1.6.3