In [1]:
f2 = open('refrdfM2.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])]) 
f2 = open('wrongrdfM2.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])]) 

%pylab inline
gn2 = np.array(g2)
gn3 = np.array(g3)


Populating the interactive namespace from numpy and matplotlib

In [4]:
plt.figure(figsize=(8,6), dpi=80)
#plt.axis([0, 17, 0,8])
plt.xlabel(r'$r,\  (\AA)$',fontsize=20)
plt.ylabel(r'$g(r),\  RDF$',fontsize=20)
plt.plot(10*gn2[:,0],gn2[:,1],'r-', label="Reproduction Test")
plt.plot(gn3[:,0],gn3[:,1],'b--', label="Reference CG")
plt.legend(loc='upper right')
savefig("wrongrdf.png",bbox_inches='tight', dpi=300)



In [ ]: