From: Ashar Malik (
Date: Thu Mar 30 2017 - 02:18:27 CDT

I think there is a way in which you can export the plot value to file - but
I use another way. I take the output file from my simulation and my
hardcoded python script to get all the values out which I can process



import sys,os

a_ = sys.argv[1]

if a_.split('.')[-1] != 'log':
raise TypeError('Hardcoded to work for NAMD style log files. File should be
an MD stdout - with a .log extension')
if os.path.isfile(a_.split('.log')[0] + '_energy.dat'):
raise ValueError('Previous run left some files - you sure you know what you
are doing :: delete that and retry')

g_ = open(a_.split('.log')[0] + '_energy.dat','a')

count_T = 0
with open(a_,'r') as f_:
for line in f_:
if line[0:6] == "ETITLE":
count_T += 1
if count_T == 1:
if line[0:6] == "ENERGY":


This will generate a file with just numbers of interest. It will be a
formatted file with all values extracted from the log.

You can then couple the above script with something like this::

d = np.genfromtxt(a_.split('.log')[0] +

replacing the ??? with your column of interest.

e.g from the file created if you are looking for temperature - it would be
column 12 ---

d would then be a 2 column array - with the first holding step values and
second holding your variable of interest.

The script takes an input - so make it an executable with chmod

and run it like this

./script_file_name md.log

The export function from the plot maybe easier but this is what I did when
I had to do it.

Let me know if this doesn't work. Hope this helps.


On Thu, Mar 30, 2017 at 7:21 PM, Monika Madhavi <>

> Dear all,
> I know I can plot the properties of the system with time using "NAMD plot"
> in VMD. I want to know is it possible to extract data points of these plots
> from the log file (e.g temperature values with the time step) using VMD. I
> would be grateful for any help.
> Thank you.
> Best regards,
> Monika
> --
> W.A.Monika Madhavi
> Lecturer (Probation),
> Department of Physics,
> University of Colombo.