1 /////////////////////////////////////////////////////////////////
3 /////////////////////////////////////////////////////////////////
11 int main (int argc, char **argv){
13 if (argc == 1 || argc > 3){
14 cerr << "Usage: makegnuplot annotscores [refscores]" << endl;
18 ifstream data (argv[1]);
21 cerr << "ERROR: Could not open file " << argv[1] << endl;
26 while (data >> x) ct++;
29 ofstream out ("temporary_gnuplot_script");
32 cerr << "ERROR: Could not create temporary file." << endl;
36 out << "set title \"Column Reliability Scores\"" << endl
37 << "set xlabel \"Alignment Position\"" << endl
38 << "set ylabel \"Column Reliability\"" << endl
39 << "set xr [1:" << ct << "]" << endl
40 << "set term postscript enhanced color" << endl
41 << "set output \"reliability.ps\"" << endl;
44 out << "set style fill solid 0.5 noborder" << endl
45 << "plot \"" << argv[2] << "\" title \"actual\" with boxes lt 2, \\" << endl
46 << " \"" << argv[1] << "\" title \"predicted\" with histeps lt 1 lw 3" << endl;
49 out << "plot \"" << argv[1] << "\" title \"predicted\" with histeps lt 1 lw 3" << endl;
53 if (system ("gnuplot temporary_gnuplot_script") == -1){
54 cerr << "ERROR: Could not run Gnuplot correctly." << endl;
58 //system ("rm temporary_gnuplot_script");