#set terminal qt font "Arial,25" size 1600, 1600 enhanced dashed
set terminal qt font "Arial,22" size 1000, 1000 enhanced dashed
set colors classic
#set output "fig_mcd_interaction.png"

set rmargin 0
set lmargin 0
set tmargin 0
set bmargin 0

set border linewidth 3.0

set xrange[638:656]
set yrange[-0.15:1.1]

set xtics  5   offset 0.0,0.15
set ytics  0.4 offset 0.0,0.0 scale 1.5
set mxtics 5
set mytics 4
set format y "%2.1f"

#====================================
f0(x) = 0.0
f2(x) = 0.3
f4(x) = 0.6
f6(x) = 0.9
factor=-0.35
#=============================================================== 
#
set format x "%2.0f"
unset xlabel; unset ylabel
#
#===============================================================   left,top
set size   0.58, 0.72
set origin 0.18, 0.27

unset key
set key nobox font 'Arial,20' at graph 0.95,0.78 vertical maxrows 4 maxcolumns 1 samplen 2

unset label
set label 1 at first  644.2, 0.98 "Full Hamiltonian"    font 'Arial,26' tc rgb "red"
set label 2 at first  647.7, 0.70 "no SOC_{3d}"         font 'Arial,26' tc rgb "dark-green"
set label 3 at first  647.7, 0.40 "no CV"               font 'Arial,26' tc rgb "blue"
set label 4 at first  643.5, 0.12 "no SOC_{3d}, no CV"  font 'Arial,26' tc rgb "magenta"

set xlabel 'Energy (eV)'        offset   0.0, 0.3 font 'Arial,26'
set ylabel 'Mn L_{2,3}-edge XMCD intensity' offset   0.2, 0.0 font 'Arial,26'


plot "data/full_interaction/mirror_110/XAS.dat/case2/xas_tot_mcd.dat"  u ($1+643.0130510319171):($3*factor+0.9)  w l lt 1 lw 4.0 lc 1 notitle "Full Hamiltonian",\
     "data/no_SOC/mirror_110/XAS.dat/case2/xas_tot_mcd.dat"            u ($1+643.0130510319171):($3*factor+0.6)  w l lt 1 lw 4.0 lc rgb "dark-green" notitle "no SOC",\
     "data/no_CV/mirror_110/XAS.dat/case2/xas_tot_mcd.dat"             u ($1+643.0130510319171):($3*factor+0.3)  w l lt 1 lw 4.0 lc 3 notitle "no CV",\
     "data/no_SOC_CV/mirror_110/XAS.dat/case2/xas_tot_mcd.dat"         u ($1+643.0130510319171):($3*factor+0.0)  w l lt 1 lw 4.0 lc 4 notitle "no SOC, no CV",\
     f0(x) w l dt 2 lw 1.5 lc -1 notitle,\
     f2(x) w l dt 2 lw 1.5 lc -1 notitle,\
     f4(x) w l dt 2 lw 1.5 lc -1 notitle,\
     f6(x) w l dt 2 lw 1.5 lc -1 notitle
 
#===============================================================