import numpy as np
import matplotlib.pyplot as plt
import pylab

# turn on latex
plt.rc('text', usetex=True)
# title and axis labels
plt.title(r'T exact vs path integral')
plt.xlabel(r'$k$')
plt.ylabel(r'T')
#y2=plt.ylabel(r'$K(k,k^{\prime},k^{\prime})$')
#y3=plt.ylabel(r'$\mathbb{R}e(T(k,k^{\prime},k^{\prime}))$')
#y4 plt.ylabel(r'$\mathbb{I}m(T(k,k^{\prime},k^{\prime}))$')
#read file from out.dat
#x, y = np.loadtxt('momentum_wf.dat', delimiter=None, unpack=True)
x,y,z = np.loadtxt('fig_26e.dat', delimiter=None, unpack=True)
#x,y,z = np.loadtxt('ex2pc1.out', delimiter=None, unpack=True)
u,v,w = np.loadtxt('fig_26a.dat', delimiter=None, unpack=True)
#r,s,t = np.loadtxt('exp3b.out', delimiter=None, unpack=True)
#r,s,t = np.loadtxt('fig_24.dat', delimiter=None, unpack=True)
#x, y, z  = np.loadtxt('psi_m_x_5.out', delimiter=None, unpack=True)
#r, s, t   = np.loadtxt('psi_m_x_5_20000.out', delimiter=None, unpack=True)
#turn on interactive mode - not necessary
plt.ion()
#plot limits
pylab.xlim(-5.0,15.0) 
#plot commands with color symbol and label
pylab.plot(u,v, 'k-.',label='$Re(T)$ path') 
pylab.plot(x,y, 'r--',label='$Re(T)$ exact')
#pylab.plot(r, s, 'b--',label='$Re$ path')
#pylab.plot(r,s, 'g--',label='$Re$ f8') 
#pylab.plot(r,t, 'g--',label='$Im$ f8')
#pylab.plot(u,w, 'k-.',label='$Im(T)$ path')
#pylab.plot(x,z, 'r--',label='$Im(T)$ exact')
#pylab.plot(r,t, 'b:',label='$Im$ path')
#labels - : -. --
pylab.legend(loc='lower left')
plt.savefig('fig_24.pdf')
#plt.show()
