from scipy import *
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import matplotlib as mpl
import sys

mpl.rc('text', usetex=True)

#file_band = sys.argv[1]
#file_dos = sys.argv[2]

band = loadtxt('BGG_phband.bands')
band_scph = loadtxt('scph_offdiag100K.dat')
#dos = loadtxt(file_dos)
#ndata = len(dos)

#dos_Ba1 = np.zeros(ndata)
#dos_Ba2 = np.zeros(ndata)
#dos_Ga = np.zeros(ndata)
#dos_Ge = np.zeros(ndata)
#dos_cage = np.zeros(ndata)

gs = gridspec.GridSpec(1,1)

#gs = plt.add_subplot(111)

gs.update(wspace = 0.05)
ax_band = plt.subplot(gs[0])
#ax_dos = plt.subplot(gs[1])

#ax_band = plt.subplot(111)
ax_band.plot(band[:,0], band[:,1], color='blue', label="Harmonic")    
ax_band.plot(band[:,0], band[:,2:], color='blue')    
ax_band.plot(band_scph[:,1], band_scph[:,2], color='red', label="SCPH (100 K)")        
ax_band.plot(band_scph[:,1], band_scph[:,3:], color='red')        

ax_band.grid('on')
#ax_band.axis([0, 1.2992, 0, 300])
ax_band.axis([0, 0.750997, 0, 220])


kpname = ["$\Gamma$", "$X$", "$M$", "$\Gamma$", "$R$"]
kpval = [0, 0.145931, 0.291861, 0.498238, 0.750997]

ax_band.axes.set_xticks(kpval)
ax_band.axes.set_xticklabels(kpname, fontsize=18)
ax_band.axes.set_ylabel(r"Frequency [cm$^{-1}$]", fontsize=18)
plt.setp(ax_band.get_yticklabels(), fontsize=18)
plt.legend(loc='upper right')
plt.savefig('BGG_phband_big.eps', fmt='eps', transparent=True)
plt.show()
