How can I analyze my .rdf out file?

Dear Chang

Thank you for your reply,

Xmgrace can read .xvg or .agr, But .rdf is the different format.

How can It read it?


If necessary, you need to modify your rdf file to fit an appropriate format for any tools.

Take carefully a look at your rdf file and modify if for what you want to analyze.

Basically, y axis represents g® and x axis represent d (distance).

Or, take any papers how other authors have analyzed rdf.

CW Jang

Dear Chang

Thank you for your reply,

Xmgrace can read .xvg or .agr, But .rdf is the different format.

How can It read it?

as you were told before. write a little script/program in
python/perl/fortran/c/matlab/lisp/APL/whatever to refactor the data in
the file in the way you need it for your plotting program of choice.
it is a trivial task. if you don't know how to do it, now is a good
point to learn it.
otherwise you should either consider a different career, since these
kind of tasks are just part of the business and will always be
required or outsource the work to somebody (e.g. an computer science
student looking for an opportunity to try his/her programming skills,
or a free meal).

it is very unlikely that somebody here will do that for you (and
particularly not for free).


.rdf is not of a particular format. It is simply a text file.

Say I am outputting rdf information of a system with two types of atoms via the following script:

compute myRDF all rdf 2000 1 1 1 2 2 2
fix 3 all ave/time 2 2500 5000 c_myRDF file test.rdf mode vector

Then I will get something like this in the test.rdf

Time-averaged data for fix 3

TimeStep Number-of-rows

Row c_myRDF[1] c_myRDF[2] c_myRDF[3] c_myRDF[4] c_myRDF[5] c_myRDF[6] c_myRDF[7]

1005000 2000
1 0.0030625 0 0 0 0 0 0
2 0.0091875 0 0 0 0 0 0
3 0.0153125 0 0 0 0 0 0
4 0.0214375 0 0 0 0 0 0
5 0.0275625 0 0 0 0 0 0
6 0.0336875 0 0 0 0 0 0
7 0.0398125 0 0 0 0 0 0
8 0.0459375 0 0 0 0 0 0
9 0.0520625 0 0 0 0 0 0

The first column is the bin number, second the bin coordinate, third-forth, fifth-sixth, seventh-eighth are respectively g® and coord® between 1-1, 1-2, and 2-2 atom pairs.

Please refer to page 351 of the LAMMPS manual for detailed information.

Any plotting tool can give you the rdf graph. Simple copy-and-paste does the job, if you do not want to write a little script by yourself.

Say, I am using Excel and I need the rdf of atom 1. Then just copy column 2 and column 3 and feed them into Excel. Whoa-la.

In case you do not know how to copy only one column, I find notepad++ quite handy:

Press alt and then you can select the particular range you want.

Finally, to my knowledge, only restart files are of binary format. All the other LAMMPS outputs are simply text files.

So, please take a look (with your own text editor) at the files you are interested before posting a vague question onto the mail-list.

LC Liu

Dear Esther

Thank you very much for your reply,

I am doing that,