33 #ifndef GNUPLOT_OUTPUT_H_
34 #define GNUPLOT_OUTPUT_H_
36 template<
typename Vector_type,
typename postype>
38 postype *positions,
int dimensions,
const Vector_type *compareVec=NULL)
40 size_t N = A.num_rows();
41 std::fstream f((filename+
".sh").c_str(), std::ios::out);
43 "cat > gnuplotTemporaryFile <<EOF\n"
45 "set style data lines\n"
49 for(
size_t i=0; i < N; i++)
50 f << positions[i][0] <<
" " << v[i] <<
"\n";
51 else if(dimensions == 2)
52 for(
size_t i=0; i < N; i++)
53 f << positions[i][0] <<
" " << positions[i][1] <<
" " << v[i] <<
"\n";
55 for(
size_t i=0; i < N; i++)
56 f << positions[i][0] <<
" " << positions[i][1] <<
" " << positions[i][2] <<
" " << v[i] <<
"\n";
59 "cat gnuplotTemporaryFile | gnuplot -persist\n"
60 "rm gnuplotTemporaryFile\n";
void WriteVectorGnuplot(std::string filename, const Vector_type &v, postype *positions, int dimensions, const Vector_type *compareVec=NULL)
Definition: gnuplot_output.h:37