In [3]:
f2 = open('N-NAAI.dat', 'r');
lines = f2.readlines();
f2.close();
g1 = []
for line in lines:
    p = line.split()
    if len(p) > 1:
        g1.append([float(p[0]),float(p[1])]) 
f2 = open('rdfAALow.dat', 'r');
lines = f2.readlines();
f2.close();
g2 = []
for line in lines:
    p = line.split()
    if len(p) > 1:
        g2.append([float(p[0]),float(p[1])]) 
f2 = open('rdfAAhigh.dat', 'r');
lines = f2.readlines();
f2.close();
g3 = []
for line in lines:
    p = line.split()
    if len(p) > 1:
        g3.append([float(p[0]),float(p[1])])

In [64]:
%pylab inline
gn1 = np.array(g1)
gn2 = np.array(g2)
gn3 = np.array(g3)
rx3 = 10*gn3[130:340,0]
ry3 = gn3[130:340,1]
len(gn1[:,1])


Populating the interactive namespace from numpy and matplotlib
Out[64]:
869

In [65]:
plt.figure(figsize=(8,6), dpi=80)
plt.axis([0, 20, 0,6])
plt.xlabel(r'$r,\  (\AA)$',fontsize=20)
plt.ylabel(r'$g(r),\  RDF$',fontsize=20)
#plt.plot(10*gn1[:,0],gn1[:,1],'g-', label="Low")
#plt.plot(10*gn2[:,0],gn2[:,1],'r-', label="Intermediate")
plt.plot(10*gn3[:,0],gn3[:,1],'b-', label="High")
plt.plot(rx3,ry3,'k-', label="asda")
plt.legend(loc='upper right')
savefig("rdfAA.pdf", dpi=300)



In [58]:
inte1 = np.trapz(ry,rx)
print inte1
inte2 = np.trapz(ry2,rx2)
print inte2
inte3 = np.trapz(ry3,rx3)
print inte3


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-58-a3e91b87f25d> in <module>()
      3 inte2 = np.trapz(ry2,rx2)
      4 print inte2
----> 5 inte3 = np.trapz(ry3,rx3)
      6 print inte3

NameError: name 'ry3' is not defined
8.16112150159
13.4514275834

In [ ]: