#!/usr/local/bin/gnuplot -persist
set terminal postscript portrait enhanced color dashed lw 1.5 font 'Arial-Bold, 20'  
set output "energy.ps"
set size 2,2
set origin 0,0
set key autotitle columnhead font 'Arial-Bold,20' out horiz top 


set multiplot layout 2,2
set label 1 '(a)' at screen 0.75,1.22 font 'Arial-Bold 20'
set label 2 '(b)' at screen 1.6,1.22 font 'Arial-Bold 20'

set datafile missing "NaN"
#set key autotitle columnhead font 'Arial-Bold' box lw 1.5 at 8.4, 1.2 width 2.6
set title "Without ZPE" font 'Arial-Bold, 20'
set xrange [ -0.5 : 6.5 ]
set yrange [ 0.3: 0.8]
#set yrange [ 0.3: 1.2]
set size ratio 1.2
set ylabel 'E_{coh} (eV/H_2O)' font 'Arial-Bold 20' offset +2
set tics font 'Arial-Bold,20'
set border lw 1.5
set lmargin -2
unset logscale y
unset  key
set grid
set grid lc rgb '#D3D3D3  lw 0.5'
set size 0.9,2
set origin 0,0.0





plot "Figure_2_3.txt" using ($2):xticlabels(1) with linespoints  lw 2 ps 1.5 dt 2 pt 1, "" using ($3):xticlabels(1) with linespoints  lw 2 ps 1.5 dt 3 pt 2, "" using ($4):xticlabels(1) with linespoints  lw 2 ps 1.5 dt 4 pt 3, "" using ($5):xticlabels(1) with linespoints  lw 2 ps 1.5 dt 5 pt 4, "" using ($6):xticlabels(1) with linespoints  lw 2 ps 1.5 dt 7 pt 6, "" using ($7):xticlabels(1) with points  lw 2 ps 2.5 dt 8 pt 5, "" using ($8):xticlabels(1) with linespoints  lw 2 ps 1.5 dt 1 pt 7, "" using ($9):xticlabels(1) with linespoints  lw 2 ps 1.5 dt 1 pt 8, "" using ($10):xticlabels(1)  with linespoints  lw 2 ps 1.5 dt 1 pt 9, "" using ($11):xticlabels(1)  with linespoints  lw 2 ps 1.5 dt 1 pt 10, "" using ($12):xticlabels(1)  with linespoints  lw 2 ps 1.5 dt 1 pt 11, "" using ($13):xticlabels(1)  with linespoints  lw 2 ps 1.5 dt 1 pt 12


set title "With ZPE" font 'Arial-Bold, 20'
set ylabel 'E^{ZPE}_{coh}  (eV/H_2O)' font 'Arial-Bold, 20' offset +2
set tics font 'Arial-Bold,20'
set border lw 1.5
set lmargin -2
unset logscale y
set yrange [ 0.3: 0.8]
#set yrange [ 0.3: 1.2]
set grid
set grid lc rgb '#D3D3D3  lw 0.5'
set size 0.9,2
set origin 0.85,0.0
unset key

plot "Figure_2_3_zpe.txt" using ($2):xticlabels(1) with linespoints  lw 2 ps 1.5 dt 2 pt 1, "" using ($3):xticlabels(1) with linespoints  lw 2 ps 1.5 dt 3 pt 2, "" using ($4):xticlabels(1) with linespoints  lw 2 ps 1.5 dt 4 pt 3, "" using ($5):xticlabels(1) with linespoints  lw 2 ps 1.5 dt 5 pt 4, "" using ($6):xticlabels(1) with linespoints  lw 2 ps 1.5 dt 7 pt 6, "" using ($7):xticlabels(1) with points  lw 2 ps 2.5 dt 8 pt 5, "" using ($8):xticlabels(1) with linespoints  lw 2 ps 1.5 dt 1 pt 7, "" using ($9):xticlabels(1) with linespoints  lw 2 ps 1.5 dt 1 pt 8, "" using ($10):xticlabels(1)  with linespoints  lw 2 ps 1.5 dt 1 pt 9, "" using ($11):xticlabels(1)  with linespoints  lw 2 ps 1.5 dt 1 pt 10, "" using ($12):xticlabels(1)  with linespoints  lw 2 ps 1.5 dt 1 pt 11, "" using ($13):xticlabels(1)  with linespoints  lw 2 ps 1.5 dt 1 pt 12

set size 2,0.5
set origin 0.45,0.12
set key outside horizontal 
set border 0
unset title
unset tics
unset xlabel
unset ylabel
set yrange [0:0.1]
plot "Figure_2_3.txt" using ($2):xticlabels(1) with linespoints  lw 2 ps 1.5 dt 2 pt 1, "" using ($3):xticlabels(1) with linespoints  lw 2 ps 1.5 dt 3 pt 2, "" using ($4):xticlabels(1) with linespoints  lw 2 ps 1.5 dt 4 pt 3, "" using ($5):xticlabels(1) with linespoints  lw 2 ps 1.5 dt 5 pt 4, "" using ($6):xticlabels(1) with linespoints  lw 2 ps 1.5 dt 7 pt 6, "" using ($7):xticlabels(1) with points  lw 2 ps 2.5 dt 8 pt 5, "" using ($8):xticlabels(1) with linespoints  lw 2 ps 1.5 dt 1 pt 7, "" using ($9):xticlabels(1) with linespoints  lw 2 ps 1.5 dt 1 pt 8,  "" using ($11):xticlabels(1)  with linespoints  lw 2 ps 1.5 dt 1 pt 10 lc 10, "" using ($12):xticlabels(1)  with linespoints  lw 2 ps 1.5 dt 1 pt 11 lc 11, "" using ($13):xticlabels(1)  with linespoints  lw 2 ps 1.5 dt 1 pt 12 lc 12

unset multiplot

