00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef GNUPLOT_HH
00022 #define GNUPLOT_HH
00023
00024 #include <string>
00025 #include <iostream>
00026 #include <vector>
00027 #include "version.h"
00028
00029 using namespace std;
00030
00031
00033
00037 class gnuplot {
00038
00039 public:
00041
00062 bool autoscale;
00064
00075 int pause;
00077
00080 bool plot3d;
00082
00086 string style;
00088
00106 float time;
00108
00127 string title;
00129
00132 string xlabel;
00134
00137 string ylabel;
00139
00142 string zlabel;
00144
00148 gnuplot(const bool = true);
00150
00154 ~gnuplot();
00156
00182 gnuplot& flush(const bool = true);
00184
00205 gnuplot& operator<<(const string);
00207
00234 gnuplot& operator<<(const double);
00235 gnuplot& operator<<(gnuplot& (*f)(gnuplot&));
00237
00241 void reset_fp();
00243
00273 void set_fp(FILE* const, const bool = false);
00275
00281 void set_graphs(unsigned short);
00283
00291 void set_log(const string = "");
00293
00326 void set_multiplot(const unsigned char = 1, const unsigned char = 1);
00328
00337 void set_multiplot(const string);
00339
00344 void set_nolog(const string = "");
00346
00351 void set_nomultiplot();
00353
00358 void set_output(const string);
00360
00373 void set_title(const string);
00375
00381 void set_xlabel(const string);
00383
00388 void set_xrange(const string);
00390
00393 void set_ylabel(const string);
00395
00398 void set_yrange(const string);
00400
00403 void set_zlabel(const string);
00405
00408 void set_zrange(const string);
00409
00410 private:
00411 FILE *fp, *fp_;
00412 unsigned char n, plots[2];
00413 unsigned short graphs, graph, plot;
00414 bool data_only, first_dataset, first_flush, first_number, multiplot, new_plot;
00415 vector<vector<double> > buf;
00416 vector<double> first_buf;
00417 gnuplot(const gnuplot&);
00418 gnuplot& operator=(const gnuplot&);
00419
00420 };
00421
00422
00423 gnuplot& flush(gnuplot&);
00424
00425 #endif // GNUPLOT_HH