#set terminal pngcairo font "Arial,23" size 900,700 dashed
set terminal qt font "Arial,30" size 1200,1000 dashed
set colors classic
#set output "fig4.png"

set key box lw 2.5 font "Arial,28" maxrow 4 at graph 0.98, 0.98 samplen 2.4
set key nobox
set multiplot layout 3,3

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

set yrange[-0.4:1.50]
set xtics nomirror
set ytics nomirror
set mxtics 5
set ytics  1 offset 0.0,0.0
set mytics 10
set format y "%2.0f"

unset arrow 1; unset arrow 2; unset arrow 3; unset arrow 4; unset arrow 5; unset arrow 6

unset label 2

set border linewidth 3.5
#---------------------------------
set size   0.40, 0.70
set origin 0.15, 0.20
set format x "%2.0f"

set border 15

set xrange[636:656]
set xtics 10 offset 0.0,0.0

set ylabel 'L-edge Intensity' offset  0.8, 0.0 font 'Arial,35'
set xlabel 'Energy (eV)'      offset 12.0, 0.0 font 'Arial,35'

set style circle radius 0.08
set style fill solid
set label 1 'x2' at graph 0.85, 0.10 font 'Arial,38'
a=2
b=2

plot "data/exp/degroot" u ($1):($2*1.0+0.4) with circles    lc -1 axis x1y1 notitle,\
     "data/mirror_110/XAS.dat/case2/xas_tot_mcd.dat" u ($1+642.76):($3*(-0.35)*a) w filledc below y=0.0 lc rgb "gray" notitle,\
     "data/mirror_110/XAS.dat/case2/xas_tot_mcd.dat" u ($1+642.76):($3*(-0.35)*a) w filledc above y=0.0 lc rgb "gray" notitle,\
     "data/mirror_110/XAS.dat/case2/xas_tot_P.dat" u ($1+642.76):($3*(-0.35)) w l lw 3.5 lc  'red' notitle 'plus',\
     "data/mirror_110/XAS.dat/case2/xas_tot_M.dat" u ($1+642.76):($3*(-0.35)) w l lw 3.5 lc  'blue' notitle 'minus',\
     "data/mirror_110/XAS.dat/case2/xas_tot_mcd.dat" u ($1+642.76):($3*(-0.35)*a) w l lw 3.5 lc  'black' notitle 'MCD'
set format x ""
#---------------------------------
set size   0.40, 0.70
set origin 0.57, 0.20
set format x "%2.0f"

set noytics

unset xlabel; unset ylabel

set label 1 'x2' at graph 0.85, 0.10 font 'Arial,38'

plot "data/exp/degroot" u ($1):($2*1.0+0.4) with circles    lc -1 axis x1y1 notitle,\
     "data/b_axis/XAS.dat/case3/xas_tot_mcd.dat" u ($1+642.86):($3*(-0.35)*b) w filledc below y=0.0 lc rgb "gray" notitle,\
     "data/b_axis/XAS.dat/case3/xas_tot_mcd.dat" u ($1+642.86):($3*(-0.35)*b) w filledc above y=0.0 lc rgb "gray" notitle,\
     "data/b_axis/XAS.dat/case3/xas_tot_P.dat" u ($1+642.86):($3*(-0.35)) w l lw 3.5 lc  'red' notitle 'plus',\
     "data/b_axis/XAS.dat/case3/xas_tot_M.dat" u ($1+642.86):($3*(-0.35)) w l lw 3.5 lc  'blue' notitle 'minus',\
     "data/b_axis/XAS.dat/case3/xas_tot_mcd.dat" u ($1+642.86):($3*(-0.35)*b) w l lw 3.5 lc  'black' notitle 'MCD'
set format x ""
#--------------------------------

unset multiplot