# In gmx mdmat command, how can I place the general axis of my molecule along one of the x, y, or z ax

**URL:** <https://gromacs.bioexcel.eu/t/in-gmx-mdmat-command-how-can-i-place-the-general-axis-of-my-molecule-along-one-of-the-x-y-or-z-ax/788>\
**Category:** User discussions\
**Created:** [September 9, 2020, 10:13am UTC](https://gromacs.bioexcel.eu/t/in-gmx-mdmat-command-how-can-i-place-the-general-axis-of-my-molecule-along-one-of-the-x-y-or-z-ax/788 "2020-09-09T10:13:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![M.Yaghoubzad](https://avatars.discourse-cdn.com/v4/letter/m/96bed5/32.png) [@M.Yaghoubzad](https://gromacs.bioexcel.eu/u/M.Yaghoubzad)\
**Post date:** [September 9, 2020, 10:13am UTC](https://gromacs.bioexcel.eu/t/in-gmx-mdmat-command-how-can-i-place-the-general-axis-of-my-molecule-along-one-of-the-x-y-or-z-ax/788/1 "2020-09-09T10:13:32Z")

</div>

GROMACS version: 2020.3  
GROMACS modification: No

Hello

I use the " gmx mdmat " command to analyze the molecular dynamics results of my research. My protein is three alpha helices that are parallel to each other.

gmx mdmat -f md\_0\_1.xtc -s md\_0\_1.tpr -mean mdmat.xpm -frames mdmat2.xpm -no mdmat.xvg

In this command, how can I place the general axis of my molecule along one of the x, y, or z axes in the box?

---

<div class="post-metadata">

**Author:** ![jalemkul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/jalemkul/32/18_2.png) [@jalemkul](https://gromacs.bioexcel.eu/u/jalemkul)\
**Post date:** [September 9, 2020, 12:24pm UTC](https://gromacs.bioexcel.eu/t/in-gmx-mdmat-command-how-can-i-place-the-general-axis-of-my-molecule-along-one-of-the-x-y-or-z-ax/788/2 "2020-09-09T12:24:00Z")

</div>

`mdmat` doesn’t depend on orientation. It simply computes a distance matrix, which will be the same no matter how your species are rotated. If you want to reorient anything in your system, use `trjconv`.

---

<div class="post-metadata">

**Author:** ![M.Yaghoubzad](https://avatars.discourse-cdn.com/v4/letter/m/96bed5/32.png) [@M.Yaghoubzad](https://gromacs.bioexcel.eu/u/M.Yaghoubzad)\
**Post date:** [December 17, 2020, 2:48pm UTC](https://gromacs.bioexcel.eu/t/in-gmx-mdmat-command-how-can-i-place-the-general-axis-of-my-molecule-along-one-of-the-x-y-or-z-ax/788/4 "2020-12-17T14:48:39Z")

</div>

Thanks.  
I did the “gmx mdmat” command as follows:

gmx mdmat -f \*.xtc -s \*.tpr -meaning \*.xpm -frames \*.xpm -no \*.xvg

and use “gmx xpm2ps -f \*.xpm -di \*.m2p -o \*.eps” to make contacts map between residues. But in the output diagram, which I attached, the order of the amino acids on the x and y axes is disturbed. How can I fix the error?!

 ![mdmat](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/1X/b3db5cedaf15c35cd2515221e5a5969ec62c2f7f.png)
