Xpm2ps asks for two matrices and aborts

GROMACS version: 2020.2
GROMACS modification: No


I’m trying to use xpm2ps to convert to .eps a distance matrix produced via mdmat. Whenever I run anything like:

mx xpm2ps -f matrix.xpm

I get back this error

Program:     gmx xpm2ps, version 2020.2
Source file: src/gromacs/gmxana/gmx_xpm2ps.cpp (line 1257)
Function:    do_mat(gmx::ArrayRef<t_matrix>, gmx::ArrayRef<t_matrix>, gmx_bool, gmx_bool, gmx_bool, gmx_bool, gmx_bool, gmx_bool, gmx_bool, int, real, real, real, const char*, const char*, const char*, const char*, int, int)::<lambda()>

Assertion failed:
Condition: mat.size() == mat2.size()
Combined matrix write requires matrices of the same size

For more information and tips for troubleshooting, please check the GROMACS
website at http://www.gromacs.org/Documentation/Errors

As the assertion failing seems to be requiring a second .xpm matrix of the same size. To fulfil this condition (even if I wouldn’t need it for my analysis) I tried:

gmx xpm2ps -f matrix.xpm -f2 matrix.xpm

Only to find a new problem:

There is 1 matrix in mean.xpm
There is 1 matrix in mean.xpm
Matrix 0 is 2970 x 2970
Set the x-size of the box to 0.135
Set the y-size of the box to 0.135
Selected legend of matrix # 0 for display
Selected legend of matrix # 1 for second display

Back Off! I just backed up plot.eps to ./#plot.eps.3#
Segmentation fault (core dumped)

It writes out a corrupt plot.eps file. At first I thought it could be my matrix, but the file looks good and I tried another one I found online from a previously reported bug with the same result.

Thanks in advance!!



we just fixed this bug, and the fix will be included in 2020.3 that
comes out at the end of the month.
If you want to apply the fix yourself, please check out



Well, that was perfect timing. Thanks a lot!



To which gromacs directory should the fix file for matrix bug be downloaded? Instead of downloading new version of gromacs.

You have to install version 2020.3. There is no magic “fix file” when bugs are corrected. The source code gets amended, and you have to recompile and reinstall from the updated source.