set term post eps enh color 12 
set out "Hubbard_NNN_deriv.eps"
set size 0.5,0.5
set multiplot
set samples 1000
set rmargin 1
set lmargin 7

PS1=1.0
set style line 2 lt 2 lc rgb "#00BB00" lw 4 pt 4 ps 0.8

set xlabel "s" offset 0,0.5
set ylabel "d<S_i {/Symbol \327} S_{i+{/Symbol d}}> / ds" offset 1.2
set key samplen 2 spacing 1.3 bottom
# reverse
set xtics 0.2
set mxtics 2
set ytics 0.2
set mytics 2


set arrow 1 from log(2),-2.05 to log(2),0 nohead lt 4 lc -1 front
#set label 1 "{/Symbol d} = (1,0)" at 0.1,-0.4
#set label 2 "{/Symbol d} = (1,1)" at 0.1,0.3
set label 2 "{/=14{/Symbol d} = NNN}" at screen 0.16,0.44

#set label 3 "{/=9 Weiss MF}" at 0.1,0.96 rotate by -34

# fit function with initial slope 0, slope 1 above x0, smoothness a
f(x,x0,a)= 0.5*(sqrt((x-x0)**2+a**2)-sqrt((x0)**2+a**2)+x)

# fit function for smooth cutoff above x0 (unit value below), smoothness a
g(x,x0,a) = 0.5*(1-tanh((x-x0)/a))

set xzeroaxis

plot [0:1.05][-2.05:0]\
"Data/DMFT/results_U150mu0_spincorr_deriv.dat" u 1:3 t"DMFT" lt 1 lw 3 pt 6 ps PS1,\
"Data/DQMC_3D/sisj110u15_deriv.dat" u 1:($1>0.2?3*$3:1/0) t"d = 3" lt 3 lw 3 pt 12 ps PS1,\
"< cat Data/DQMC_2D/U12.25L6_beta_s_sisj_deriv.dat | ../bin/printcol 1 3 | ../bin/smooth12" u ($1):($1>0.2?3*$2:1/0) t "d = 2" ls 2,\
"Data/DQMC_1D/DQMC_1d_U867_N16_32_64_deriv.dat" u 1:(3*$3) t"d = 1" lt 4 lw 3 pt 1,\
"Data/Heisenberg/Heisenberg_WeissMF_corr_deriv.dat" u 1:(0.89*$2) t"" w l lt 1 lw 5,\
-1.8*x**0.3333 *g(x,0.64,0.1) t"" lt 1 lw 5 lc 3,\
x<0.85?-2.6*x**0.6666*g(x,0.66,0.1):1/0 t"" lt 1 lw 5 lc rgb "#00BB00",\
x<0.85?-2.75*x*g(x,0.66,0.1):1/0 t"" lt 1 lw 5 lc 4

# fit to d=1 Heisenberg:
# -5.3*x +3.7*f(x,0.15,0.1) t"" lt 4 lw 3 lc -1,\
# 0.86*(-5.3*x +3.7*f(x,0.15,0.1)) t"" lt 4 lw 3 lc -1,\
# 0.86*(-5.1*x +3.4*f(x,0.15,0.1))*g(x,0.67,0.1) t"" lt 4 lw 3,\
# x<0.75?0.86*(-4.8*x +3.1*f(x,0.15,0.1)-0.6*x**2)*g(x,0.66,0.1):1/0 t"" lt 1 lw 5 lc 4,\


