}
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)),
j = 0;
if (output_env_get_print_xvgr_codes(oenv))
{
+ char str1[STRLEN],str2[STRLEN];
+ if(output_env_get_xvg_format(oenv) == exvgXMGR)
+ {
+ sprintf(str1,"@ legend string ");
+ sprintf(str2," ");
+ }
+ else
+ {
+ sprintf(str1,"@ s");
+ sprintf(str2," legend ");
+ }
+
for (m = 0; (m < egNR+egSP); m++)
{
if (egrp_use[m])
{
- fprintf(out, "@ legend string %d \"%s\"\n", j++, egrp_nm[m]);
+ fprintf(out, "%s%d%s \"%s\"\n", str1, j++, str2, egrp_nm[m]);
}
}
if (bFree)
{
- fprintf(out, "@ legend string %d \"%s\"\n", j++, "Free");
+ fprintf(out, "%s%d%s \"%s\"\n", str1, j++, str2, "Free");
}
if (bFree)
{
- fprintf(out, "@ legend string %d \"%s\"\n", j++, "Diff");
+ fprintf(out, "%s%d%s \"%s\"\n", str1, j++, str2, "Diff");
}
fprintf(out, "@TYPE xy\n");
fprintf(out, "#%3s", "grp");
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);
- if(output_env_get_print_xvgr_codes(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)