Make sure figure legends are adapted to xmgr/xmgrace
[alexxy/gromacs.git] / src / tools / gmx_analyze.c
index 2b8f2827b3bf3c95c2e14fefe43874bdc2319a7f..b201f94be8b7795e25835eb06ed0aefcddb0f119 100644 (file)
@@ -615,11 +615,16 @@ static void estimate_error(const char *eefile, int nb_min, int resol, int n,
         }
         fprintf(stdout, "Set %3d:  err.est. %g  a %g  tau1 %g  tau2 %g\n",
                 s+1, ee, a, tau1, tau2);
-        if(output_env_get_print_xvgr_codes(oenv))
+        if (output_env_get_xvg_format(oenv) == exvgXMGR)
         {
             fprintf(fp, "@ legend string %d \"av %f\"\n", 2*s, av[s]);
             fprintf(fp, "@ legend string %d \"ee %6g\"\n",2*s+1, sig[s]*anal_ee_inf(fitparm, n*dt));
         }
+        else if (output_env_get_xvg_format(oenv) == exvgXMGRACE)
+        {
+            fprintf(fp, "@ s%d legend \"av %f\"\n", 2*s, av[s]);
+            fprintf(fp, "@ s%d legend \"ee %6g\"\n",2*s+1, sig[s]*anal_ee_inf(fitparm, n*dt));
+        }
         for (i = 0; i < nbs; i++)
         {
             fprintf(fp, "%g %g %g\n", tbs[i], sig[s]*sqrt(ybs[i]/(n*dt)),