g_mdmat invalid xvg output for legend. OR: g_mdmat, g_analyze, g_enemat output xmgr xvg format for xmgrace?
Using g_mdmat from GROMACS 4.5.4, the xvg output file formats the legend metadata in a way that xmgrace 5.1.22 does not understand, complaining of "Unallocated set: LEGEND STRING ..." for each legend entry.
Example g_mdmat command:
g_mdmat \ -f testout/20110720-1614/trajectory.trr \ -s tpr/hasyn_0001.tpr \ -n gro/hasyn_0001.ndx \ -mean testout/20110720-1614/mdmat_mean.xpm \ -frames testout/20110720-1614/mdmat_frames.xpm \ -no testout/20110720-1614/mdmat_num.xvg
The xvg file produced formats the legend as:
@ legend string 0 "Total/mean" @ legend string 1 "Total" @ legend string 2 "Mean" @ legend string 3 "# atoms" @ legend string 4 "Mean/# atoms"
but xmgrace wants
@ s0 legend "Total/mean" @ s1 legend "Total" @ s2 legend "Mean" @ s3 legend "# atoms" @ s4 legend "Mean/# atoms"
... which is how the other g_ utilities that I've used generate it.
I'm not confident enough to suggest a diff, but the string "legend string" appears in these files:
src/tools/gmx_analyze.c lines 552 553
src/tools/gmx_enemat.c lines 417 419 421
src/tools/gmx_mdmat.c lines 324-328
src/tools/gmx_saltbr.c line 252 -- this seems to only be output for xmgr, as (I think) is correct. Maybe that's the problem with g_mdmat?
src/gmxlib/xvgr.c line 358 -- again, only for xmgr
My guess is that g_analyze, g_enemat and g_mdmat are producing xmgr format xvg files when they should output xmgrace files.
Make sure figure legends are adapted to xmgr/xmgrace
A few programs were not using the xvgr_legend call. g_mdmat
has been modified to use it, and for g_analyse and g_enemat
I at least fixed the existing direct-writing code by adding