1 /////////////////////////////////////////////////////////////////
3 /////////////////////////////////////////////////////////////////
10 int main (int argc, char **argv){
12 if (argc == 1 || argc > 3){
13 cerr << "Usage: makegnuplot annotscores [refscores]" << endl;
17 ifstream data (argv[1]);
20 cerr << "ERROR: Could not open file " << argv[1] << endl;
25 while (data >> x) ct++;
28 ofstream out ("temporary_gnuplot_script");
31 cerr << "ERROR: Could not create temporary file." << endl;
35 out << "set title \"Column Reliability Scores\"" << endl
36 << "set xlabel \"Alignment Position\"" << endl
37 << "set ylabel \"Column Reliability\"" << endl
38 << "set xr [1:" << ct << "]" << endl
39 << "set term postscript enhanced color" << endl
40 << "set output \"reliability.ps\"" << endl;
43 out << "set style fill solid 0.5 noborder" << endl
44 << "plot \"" << argv[2] << "\" title \"actual\" with boxes lt 2, \\" << endl
45 << " \"" << argv[1] << "\" title \"predicted\" with histeps lt 1 lw 3" << endl;
48 out << "plot \"" << argv[1] << "\" title \"predicted\" with histeps lt 1 lw 3" << endl;
52 if (system ("gnuplot temporary_gnuplot_script") == -1){
53 cerr << "ERROR: Could not run Gnuplot correctly." << endl;
57 //system ("rm temporary_gnuplot_script");