Remove unnecessary config.h includes
[alexxy/gromacs.git] / src / gromacs / gmxana / gmx_mdmat.c
index 46ea9a0a7abe0aed39a2c68c43de3fa41c4e4d76..cc0a6e2becd0df019bb5834520598008f9b4516e 100644 (file)
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
 #include <math.h>
 #include <string.h>
 
-#include "macros.h"
+#include "gromacs/legacyheaders/macros.h"
 #include "gromacs/math/vec.h"
-#include "typedefs.h"
+#include "gromacs/legacyheaders/typedefs.h"
 #include "gromacs/fileio/filenm.h"
 #include "gromacs/commandline/pargs.h"
 #include "gromacs/utility/futil.h"
@@ -227,7 +225,7 @@ int gmx_mdmat(int argc, char *argv[])
     output_env_t   oenv;
     gmx_rmpbc_t    gpbc = NULL;
 
-    if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_BE_NICE, NFILE, fnm,
+    if (!parse_common_args(&argc, argv, PCA_CAN_TIME, NFILE, fnm,
                            asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
@@ -367,20 +365,22 @@ int gmx_mdmat(int argc, char *argv[])
 
     if (bCalcN)
     {
+        char **legend;
+
+        snew(legend, 5);
+        for (i = 0; i < 5; i++)
+        {
+            snew(legend[i], STRLEN);
+        }
         tot_nmat(nres, natoms, nframes, totnmat, tot_n, mean_n);
         fp = xvgropen(ftp2fn(efXVG, NFILE, fnm),
                       "Increase in number of contacts", "Residue", "Ratio", oenv);
-        fprintf(fp, "@ legend on\n");
-        fprintf(fp, "@ legend box on\n");
-        fprintf(fp, "@ legend loctype view\n");
-        fprintf(fp, "@ legend 0.75, 0.8\n");
-        fprintf(fp, "@ legend string 0 \"Total/mean\"\n");
-        fprintf(fp, "@ legend string 1 \"Total\"\n");
-        fprintf(fp, "@ legend string 2 \"Mean\"\n");
-        fprintf(fp, "@ legend string 3 \"# atoms\"\n");
-        fprintf(fp, "@ legend string 4 \"Mean/# atoms\"\n");
-        fprintf(fp, "#%3s %8s  %3s  %8s  %3s  %8s\n",
-                "res", "ratio", "tot", "mean", "natm", "mean/atm");
+        sprintf(legend[0], "Total/mean");
+        sprintf(legend[1], "Total");
+        sprintf(legend[2], "Mean");
+        sprintf(legend[3], "# atoms");
+        sprintf(legend[4], "Mean/# atoms");
+        xvgr_legend(fp, 5, (const char**)legend, oenv);
         for (i = 0; (i < nres); i++)
         {
             if (mean_n[i] == 0)