54 static const char header_gnugraph_rcsid[] =
"$Id: gnugraph.h,v 1.13 2006/05/16 19:24:26 gourdeau Exp $";
57 #ifdef _MSC_VER // Microsoft 58 #pragma warning (disable:4786) // Disable decorated name truncation warnings 59 #pragma warning (disable:4503) // Disable decorated name truncation warnings 62 #if defined(__WIN32__) || defined(_WIN32) || defined(__NT__) || defined(__CYGWIN__) 64 #define GNUPLOT "wgnuplot.exe" 69 #define snprintf _snprintf 74 #define GNUPLOT "gnuplot" 75 #include <sys/types.h> 82 #include <boost/shared_ptr.hpp> 93 using namespace NEWMAT;
102 #define OUT_OF_MEMORY -1 103 #define X_Y_DATA_NO_MATCH -2 104 #define LABELS_NBR_NO_MATCH -3 119 #define NCURVESMAX 10 // maximum number of curves in the same Plot2d 130 GNUcurve(
const std::vector<double> & x, std::vector<double> & y,
153 void settitle(
const std::string & t);
154 void setxlabel(
const std::string & t);
155 void setylabel(
const std::string & t);
156 void addcurve(
const Matrix & data,
const std::string & label =
"",
159 void addcommand(
const std::string & gcom);
183 void settitle(
const std::string & t);
184 void setxlabel(
const std::string & t);
185 void setylabel(
const std::string & t);
186 void setzlabel(
const std::string & t);
187 void gnuplot(
const Matrix & xyz);
190 #define IO_COULD_NOT_OPEN_FILE -1 191 #define IO_MISMATCH_SIZE -2 192 #define IO_DATA_EMPTY -3 193 #define IO_MISMATCH_ELEMENT_NBR -4 194 #define PROBLEM_FILE_READING -5 204 short write(
const std::vector<Matrix> & data);
205 short write(
const std::vector<Matrix> & data,
const std::vector<std::string> & title);
206 short read(std::vector<Matrix> & data);
207 short read(std::vector<Matrix> & data, std::vector<std::string> & title);
208 short read_all(std::vector<Matrix> & data, std::vector<std::string> & data_title);
227 short graph(
const std::string & title_graph,
const std::string & label,
const short x,
228 const short y,
const short x_start,
const short y_start,
237 short set_plot2d(
const char *title_graph,
const char *x_axis_title,
const char *y_axis_title,
239 int start_y,
int end_y);
241 short set_plot2d(
const char *title_graph,
const char *x_axis_title,
const char *y_axis_title,
243 const Matrix &ydata,
const vector<int> & data_select);
245 short set_plot3d(
const Matrix & xyz,
const std::string & title_graph,
const std::string & x_axis_title,
246 const std::string & y_axis_title,
const std::string & z_axis_title);
std::string ylabel
Graph y axis.
std::vector< double > vdX
static const char header_gnugraph_rcsid[]
RCS/CVS version.
std::string title
Graph title.
std::string clabel
string defining the curve label for the legend
std::string xlabel
Graph x axis.
std::vector< std::string > data_title
Data file title.
LineType_en enLineType
Line type.
std::vector< Matrix > data_from_file
Data file.
std::vector< PSHR_Curve > VectorCurves
short set_plot2d(const char *title_graph, const char *x_axis_title, const char *y_axis_title, const char *label, LineType_en enLineType, const Matrix &xdata, const Matrix &ydata, int start_y, int end_y)
The usual rectangular matrix.
Read and write data at every iterations in a file.
std::string zlabel
Graph z axis.
int position_read
Position to read the file.
Plot3d()
Default constructor.
std::vector< double > vdY
std::string gnucommand
GNU plot command.
short set_plot3d(const Matrix &xyz, const std::string &title_graph, const std::string &x_axis_title, const std::string &y_axis_title, const std::string &z_axis_title)
Creates a graphic from a data file.
boost::shared_ptr< GNUcurve > PSHR_Curve
std::string filename
File name.