Avoid writing xvgr formatting with -xvg none
[alexxy/gromacs.git] / src / tools / anadih.c
index af9e6eb0be33703a1584951ed3b5dcef011610e5..5f5da0eefba94486a9cf09ebfc4f653ca0e5e3bc 100644 (file)
@@ -568,9 +568,12 @@ void get_chi_product_traj (real **dih, int nframes, int nangles, int nlist,
                 sprintf(histitle, "cumulative rotamer distribution for %s", dlist[i].name);
                 fprintf(stderr, "  and %s  ", hisfile);
                 fp = xvgropen(hisfile, histitle, "number", "", oenv);
-                fprintf(fp, "@ xaxis tick on\n");
-                fprintf(fp, "@ xaxis tick major 1\n");
-                fprintf(fp, "@ type xy\n");
+                if(output_env_get_print_xvgr_codes(oenv))
+                {
+                    fprintf(fp, "@ xaxis tick on\n");
+                    fprintf(fp, "@ xaxis tick major 1\n");
+                    fprintf(fp, "@ type xy\n");
+                }
                 for (k = 0; (k < nbin); k++)
                 {
                     if (bNormalize)
@@ -582,7 +585,7 @@ void get_chi_product_traj (real **dih, int nframes, int nangles, int nlist,
                         fprintf(fp, "%5d  %10d\n", k, chi_prhist[k]);
                     }
                 }
-                fprintf(fp, "&\n");
+                fprintf(fp, "%s\n", output_env_get_print_xvgr_codes(oenv) ? "&" : "");
                 ffclose(fp);
             }