53 #ifdef _MSC_VER // Microsoft
54 #pragma warning (disable:4786) // Disable decorated name truncation warnings
55 #pragma warning (disable:4503) // Disable decorated name truncation warnings
58 #if defined(__WIN32__) || defined(_WIN32) || defined(__NT__) || defined(__CYGWIN__)
60 #define GNUPLOT "gnuplot.exe"
65 #define snprintf _snprintf
70 #define GNUPLOT "gnuplot"
71 #include <sys/types.h>
78 #include <boost/shared_ptr.hpp>
89 using namespace NEWMAT;
98 #define OUT_OF_MEMORY -1
99 #define X_Y_DATA_NO_MATCH -2
100 #define LABELS_NBR_NO_MATCH -3
115 #define NCURVESMAX 10 // maximum number of curves in the same Plot2d
126 GNUcurve(
const std::vector<double> & x, std::vector<double> & y,
127 const std::string & label =
"", LineType_en enLineType = LINES);
131 std::vector<double> vdX;
132 std::vector<double> vdY;
137 typedef boost::shared_ptr<GNUcurve> PSHR_Curve;
138 typedef std::vector<PSHR_Curve> VectorCurves;
149 void settitle(
const std::string & t);
150 void setxlabel(
const std::string & t);
151 void setylabel(
const std::string & t);
152 void addcurve(
const Matrix & data,
const std::string & label =
"",
153 LineType_en enLineType = DATAPOINTS);
155 void addcommand(
const std::string & gcom);
163 VectorCurves vCurves;
179 void settitle(
const std::string & t);
180 void setxlabel(
const std::string & t);
181 void setylabel(
const std::string & t);
182 void setzlabel(
const std::string & t);
183 void gnuplot(
const Matrix & xyz);
186 #define IO_COULD_NOT_OPEN_FILE -1
187 #define IO_MISMATCH_SIZE -2
188 #define IO_DATA_EMPTY -3
189 #define IO_MISMATCH_ELEMENT_NBR -4
190 #define PROBLEM_FILE_READING -5
200 short write(
const std::vector<Matrix> & data);
201 short write(
const std::vector<Matrix> & data,
const std::vector<std::string> & title);
202 short read(std::vector<Matrix> & data);
203 short read(std::vector<Matrix> & data, std::vector<std::string> & title);
204 short read_all(std::vector<Matrix> & data, std::vector<std::string> & data_title);
223 short graph(
const std::string & title_graph,
const std::string & label,
const short x,
224 const short y,
const short x_start,
const short y_start,
233 short set_plot2d(
const char *title_graph,
const char *x_axis_title,
const char *y_axis_title,
234 const char *label, LineType_en enLineType,
const Matrix &xdata,
const Matrix &ydata,
235 int start_y,
int end_y);
237 short set_plot2d(
const char *title_graph,
const char *x_axis_title,
const char *y_axis_title,
238 const vector<char *> label, LineType_en enLineType,
const Matrix &xdata,
239 const Matrix &ydata,
const vector<int> & data_select);
241 short set_plot3d(
const Matrix & xyz,
const std::string & title_graph,
const std::string & x_axis_title,
242 const std::string & y_axis_title,
const std::string & z_axis_title);