00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef _GNUPLOT_H_
00011 #define _GNUPLOT_H_
00012
00013 #include <string>
00014 #include <vector>
00015
00016 #include "util.h"
00017
00018 const double default_axis = 666666;
00019 void plotLine(std::string const& name,
00020 safevector<double> const& xx,
00021 safevector<double> const& yy,
00022 std::string const& xlabel, std::string const& ylabel,
00023 std::string const& title, std::string const& with,
00024 double ymin = default_axis,
00025 double ymax = default_axis,
00026 std::string const& options = "") throw(std::string);
00027
00028 void plotTimeSeries(std::string const& name, safevector<double> const& array,
00029 std::string const& xlabel, std::string const& ylabel,
00030 std::string const& title, std::string const& with,
00031 double ymin = default_axis,
00032 double ymax = default_axis,
00033 int start_time = 0,
00034 std::string const& options = "") throw(std::string);
00035
00036 void plotMesh(std::string const& name,
00037 safevector<double> const& xx,
00038 safevector<double> const& yy,
00039 safevector<double> const& zz,
00040 std::string const& xlabel, std::string const& ylabel,
00041 std::string const& zlabel, std::string const& title,
00042 std::string const& options = "") throw(std::string);
00043
00044
00045
00046
00047
00048 template <class T>
00049 void saveData(std::string const& name,
00050 safevector< std::pair<T,T> > const& xy,
00051 std::string const& options = "") throw(std::string) {
00052
00053 std::string filename = name + ".data";
00054 std::ofstream out(filename.c_str());
00055 for(unsigned i = 0; i < xy.size(); ++i) {
00056 out << xy[i].first << ", " << xy[i].second << std::endl;
00057 }
00058 }
00059
00060
00061
00062 safevector<double> makeinterval(double istart, double iend, unsigned steps);
00063
00064
00065 #endif//_GNUPLOT_H_