#!/home/soroush/gnuplot/bin/gnuplot -persist

set terminal postscript portrait enhanced color dashed lw 1.5 font 'Arial-Bold, 20'  
set output "Figure_2_5.ps"
set size 2,2
set origin 0,0
set encoding iso_8859_1
set xlabel  'R({\305})' font 'Arial-Bold, 20' offset -2
set key autotitle columnhead font 'Arial-Bold,20' out horiz top 


set multiplot layout 2,2
set label 1 '(a)' at screen 0.76,0.84 font 'Arial-Bold 20'
set label 2 '(b)' at screen 1.66,0.84 font 'Arial-Bold 20'

set key autotitle columnhead font 'Arial-Bold,20' out horiz top 
unset key
set size ratio 0.6
set encoding iso_8859_1
set xlabel  'R({\305})' font 'Arial-Bold, 20' offset -2
set tics font 'Arial-Bold,20'
set border lw 1.5
set grid
set grid lc rgb '#D3D3D3'  lw 0.5
set xrange [ 2.5: 6 ]
unset key
set size 0.9,0.54
set origin 0,0.45


set ylabel 'U^{LJ} (meV/H_2O)' font 'Arial-Bold, 20' offset +1.7
set title "TIP4P/2005" font 'Arial-Bold, 20' 
plot "Figure_2_5_vdw-distance-tip4p-minus-paul.txt" using 1:($2*1000) with lines  lw 2  dt 1 lc 1, "" using 1:($3*1000)  with lines  lw 2  dt 1 lc 2, "" using 1:($4*1000)  with lines  lw 2  dt 1 lc 3, "" using 1:($5*1000)  with lines  lw 2  dt 1 lc 4, "" using 1:($6*1000) with lines lw 2  dt 1 lc 5, "" using 1:($7*1000)  with lines  lw 2  dt 1 lc 6, "" using 1:($8*1000)  with lines  lw 2  dt 1 lc 7

unset key
set size 0.9,0.54
set origin 0.9,0.45

set ylabel 'U^{vdW} (meV/H_2O)' font 'Arial-Bold, 20' offset +1.1
set title "PBE+TS and TIP4P/2005" font 'Arial-Bold, 20' 
plot "Figure_2_5_vdw-distance-pbe-vdw.txt" using 1:2  with lines  lw 2  dt 1 lc 1, "vdw-distance-pbe-vdw" using 3:4  with lines  lw 2  dt 1 lc 7, "vdw-distance-pbe-vdw" using 5:6  with lines  lw 2  dt 1 lc 3, "vdw-distance-tip4p-minus-paul" using 1:($2*1000) with lines  lw 2  dt 2 lc 1,"vdw-distance-tip4p-minus-paul" using 1:($3*1000)  with lines  lw 2  dt 2 lc 7, "vdw-distance-tip4p-minus-paul" using 1:($4*1000)  with lines  lw 2  dt 2 lc 3

unset logscale 
set size 2,0.5
set origin 0.2,0.0
set key outside horizontal 
set border 0 
unset title
unset tics
unset xlabel
unset ylabel
set yrange [0:0.001]
set xrange [0:0.001]

plot "Figure_2_5_vdw-distance-tip4p-multi_by_1000.txt" using 1:2 with lines pt 1 lw 2  dt 1 lc 1, "" using 1:3  with lines pt 2 lw 2  dt 1 lc 2, "" using 1:4  with lines pt 3 lw 2  dt 1 lc 3, "" using 1:5  with lines pt 4 lw 2  dt 1 lc 4, "" using 1:6 with lines pt 5 lw 2  dt 1 lc 5, "" using 1:7  with lines pt 6 lw 2  dt 1 lc 6, "" using 1:8  with lines pt 7 lw 2  dt 1 lc 7


unset multiplot

