32 class HERMES_API
Graph :
public Hermes::Mixins::Loggable
36 Graph(
const char* title = NULL,
const char* x_axis_name = NULL,
const char* y_axis_name = NULL);
38 void set_captions(
const char* title = NULL,
const char* x_axis_name = NULL,
const char* y_axis_name = NULL);
40 void set_log_x(
bool log =
true);
41 void set_log_y(
bool log =
true);
43 void show_legend(
bool show =
true);
44 void show_grid(
bool show =
true);
46 int add_row(
const char*
name = NULL,
const char* color =
"k",
const char* line =
"-",
const char* marker =
"");
47 void set_row_style(
int row,
const char* color =
"k",
const char* line =
"-",
const char* marker =
"");
49 void add_values(
int row,
double x,
double y);
50 void add_values(
double x,
double y);
51 void add_values(
int row,
int n,
double* x,
double* y);
52 void add_values(
int row,
int n, double2* xy);
54 virtual void save(
const char* filename) = 0;
55 void save_numbered(
const char* filename,
int number);
60 bool logx, logy, legend, grid;
70 Hermes::vector<Values> data;
73 Hermes::vector<Row> rows;
82 SimpleGraph(
const char* title = NULL,
const char* x_axis_name = NULL,
const char* y_axis_name = NULL)
83 :
Graph(title, x_axis_name, y_axis_name) {}
85 virtual void save(
const char* filename);
94 MatlabGraph(
const char* title = NULL,
const char* x_axis_name = NULL,
const char* y_axis_name = NULL)
95 :
Graph(title, x_axis_name, y_axis_name) {}
97 virtual void save(
const char* filename);
103 static const char* default_terminal =
"set terminal postscript eps enhanced\n";
109 GnuplotGraph(
const char* title = NULL,
const char* x_axis_name = NULL,
const
110 char* y_axis_name = NULL,
double lines_width = 1.0,
const
112 Graph(title, x_axis_name, y_axis_name),
114 terminal_str(terminal_str),
118 virtual void save(
const char* filename);
122 void set_legend_pos(
const char* posspec);
145 PNGGraph(
const char* title = NULL,
const char* x_axis_name = NULL,
const char* y_axis_name = NULL,
146 double lines_width = 1.0,
double plot_width = 800,
double plot_height = 600);