EF1=`head -6 DOSCAR.DFT | tail -1 | awk '{print $4}'`
EF2=`head -6 DOSCAR.GW0 | tail -1 | awk '{print $4}'`
EF3=`head -6 DOSCAR.HSE | tail -1 | awk '{print $4}'`

cat >plotfile<<!
set xrange [0: 4.28044]
set yrange [-5.00000 : 5.00000]
set xtics (" R "  0.00000," G "  1.44064," X "  2.27240," M "  3.10416," G "  4.28044)
set grid
plot "wannier90_band.DFT.dat" using (\$1):(\$2-$EF1) w l lw 2 title "t2g LDA",\
     "wannier90_band.GW0.dat" using (\$1):(\$2-$EF2) w l lw 2 title "t2g RPA",\
     "wannier90_band.HSE.dat" using (\$1):(\$2-$EF3) w l lw 2 title "t2g HSE",\
     "bndstr.lda" using (\$1/0.681253*4.28044):(\$2+6.90184028-8.01486705) w lp lt 0 pt 4 ps 0.3 lc -1 title "all LDA"
!

gnuplot -persist plotfile
