Graph Class Reference

Abstract class for graphs. More...

#include <graph.h>

Inherited by GnuplotGraph, and MatlabGraph.

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)
virtual ~Graph ()
void set_captions (const char *title=NULL, const char *x_axis_name=NULL, const char *y_axis_name=NULL)
void set_key (const char *key)
void set_log_x (bool log=true)
void set_log_y (bool log=true)
void enable_legend (bool enable=true)
void enable_grid (bool enable=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_value (int row, 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=NULL)=0
void save_numbered (const char *filename, int number)

Protected Attributes

std::string title
std::string xname
std::string yname
bool logx
bool logy
bool legend
bool grid
const char * key
std::vector< Rowrows

Detailed Description

Abstract class for graphs.

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 
)
virtual Graph::~Graph (  )  [inline, virtual]

Member Function Documentation

int Graph::add_row ( const char *  name = NULL,
const char *  color = "k",
const char *  line = "-",
const char *  marker = "" 
)
void Graph::add_value ( int  row,
double  x,
double  y 
)
void Graph::add_values ( int  row,
int  n,
double2 xy 
)
void Graph::add_values ( int  row,
int  n,
double *  x,
double *  y 
)
void Graph::enable_grid ( bool  enable = true  )  [inline]
void Graph::enable_legend ( bool  enable = true  )  [inline]
virtual void Graph::save ( const char *  filename = NULL  )  [pure virtual]

Implemented in 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_key ( const char *  key  )  [inline]
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 = "" 
)

Member Data Documentation

bool Graph::grid [protected]
const char* Graph::key [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 Fri Sep 3 09:22:20 2010 for Hermes3D Library: Real Version by  doxygen 1.6.3