#include <plotter.h>
Definition at line 34 of file plotter.h.
Public Types | |
| enum | plot_cmd { plt, replt } |
Public Methods | |
| Plotter (const std::string &pp="gnuplot") | |
| Plotter (const Plotter &p) | |
| ~Plotter (void) | |
| int | plot (const std::string &cmd, Plotter::plot_cmd pc=Plotter::plt) |
| int | plot3D (const std::string &cmd) |
| int | plot (const doubleMatrix &dat, Plotter::plot_cmd pc=Plotter::plt, const std::string &options="title'y'with lines") |
| int | plot3D (const doubleMatrix &dat, const std::string &options="title'z'with lines") |
| int | replot (void) |
| int | save (const std::string &fname, const std::string &device="postscript") |
| int | set (const std::string ¶) |
| int | display (void) const |
| int | open (void) |
| void | close (void) |
Protected Attributes | |
| FILE * | plot_pipe |
| std::string | plot_program |
| std::string | data_fname |
|
|
Definition at line 41 of file plotter.h.
|
|
|
Definition at line 29 of file plotter.cpp. References data_fname, matvec::Session::mktemp(), plot_pipe, plot_program, and matvec::SESSION.
00030 {
00031 plot_program = pp;
00032 plot_pipe = 0;
00033 data_fname = SESSION.mktemp();
00034 }
|
|
|
Definition at line 36 of file plotter.cpp. References data_fname, plot_pipe, and plot_program.
00037 {
00038 plot_program = p.plot_program;
00039 plot_pipe = p.plot_pipe;
00040 data_fname = p.data_fname;
00041 }
|
|
|
Definition at line 39 of file plotter.h. References close().
00039 {close();}
|
|
|
Definition at line 134 of file plotter.cpp. References plot_pipe. Referenced by ~Plotter().
|
|
|
Definition at line 52 of file plotter.h.
00052 {std::cout<<"\tan object of Plotter\n";return 1;}
|
|
|
Definition at line 128 of file plotter.cpp. References plot_pipe, and plot_program. Referenced by plot(), plot3D(), and set().
00129 {
00130 if (! plot_pipe) plot_pipe = popen(plot_program.c_str(),"w");
00131 return 1;
00132 }
|
|
||||||||||||||||
|
Definition at line 65 of file plotter.cpp. References data_fname, matvec::Session::mktemp(), matvec::Matrix< double >::num_cols(), open(), plot_pipe, matvec::Matrix< double >::save(), matvec::SESSION, and matvec::warning().
00066 {
00067 if (pc == Plotter::replt) { data_fname = SESSION.mktemp();}
00068 dat.save(data_fname,std::ios::out);
00069 this->open();
00070 if (dat.num_cols() >= 1) {
00071 if (pc == Plotter::plt) {
00072 fprintf(plot_pipe,"plot \"%s\" %s\n",data_fname.c_str(),options.c_str());
00073 }
00074 else if (pc == Plotter::replt) {
00075 fprintf(plot_pipe,"replot \"%s\" %s\n",data_fname.c_str(),options.c_str());
00076 }
00077 }
00078 else {
00079 warning("Plotter::plot(data): data is empty");
00080 }
00081 fflush(plot_pipe);
00082 return 1;
00083 }
|
|
||||||||||||
|
Definition at line 43 of file plotter.cpp. References open(), and plot_pipe.
|
|
||||||||||||
|
Definition at line 85 of file plotter.cpp. References data_fname, matvec::Matrix< double >::num_cols(), open(), plot_pipe, matvec::Matrix< double >::save(), and matvec::warning().
00086 {
00087 dat.save(data_fname.c_str(),std::ios::out);
00088 this->open();
00089 if (dat.num_cols() >= 3) {
00090 fprintf(plot_pipe,"splot \"%s\" %s\n",data_fname.c_str(),options.c_str());
00091 }
00092 else {
00093 warning("Plotter::plot(data): data needs at least three columns");
00094 }
00095 fflush(plot_pipe);
00096 return 1;
00097 }
|
|
|
Definition at line 57 of file plotter.cpp. References open(), and plot_pipe.
|
|
|
Definition at line 99 of file plotter.cpp. References plot_pipe, and matvec::warning().
|
|
||||||||||||
|
Definition at line 119 of file plotter.cpp. References plot_pipe.
|
|
|
Definition at line 111 of file plotter.cpp. References open(), and plot_pipe.
|
|
|
|
|
|
Definition at line 57 of file plotter.h. Referenced by close(), open(), plot(), plot3D(), Plotter(), replot(), save(), and set(). |
|
|
|
1.2.16