以下代码用于生成自由能图。目前,一个新问题仍然存在,红色和蓝色实线形成时,不是形成一条线,而是分成两条。我真的不知道如何解决这个问题,因为这个脚本以前工作得很好。不幸的是,我无法在这里展示情节本身,所以请随意运行它并看看你会得到什么。这可能是操作系统问题?
使用的代码。
###subblocks to free energy diagrams###
set terminal emf font "Sans Bold,25" enhanced
set terminal emf size 620,530
makebold(text) = sprintf("{/:Bold %s}", text)
set border 15 front lt black linewidth 3.000 dashtype solid
set xlabel "Reaction Coordinate"
set xrange [-0.2:5.2]
set xtics nomirror scale 0
set ylabel "Free Energy (eV)"
set ylabel offset character 4.5,-3.0,0 font "Sans Bold,25" enhanced
set xlabel offset character 0,0.6,0 font "Sans Bold,25" enhanced
set yrange[-5:0.4]
set ytics in nomirror font "Sans Bold,25" enhanced
set key noautotitle samplen 2
set key enhanced
set errorbars 0
dx = 0.2
myFileOut(s) = sprintf("%s.emf",s)
myTitle(s) = sprintf("%s",s)
inputFiles = '/Users/total.dat'
outputDirs = "/Users//Free-Energy-2/"
do for [i=0:2] {
stats 'inputFiles' index i every ::::0 u (s=strcol(4),0) nooutput
set output outputDirs.myFileOut(s)
set title myTitle(s) offset 0,-0.93, 0
plot 'total.dat' index i u 0:2:(dx):xtic(makebold(strcol(1))) w xerr lc "blue" lw 3 ps 0 ti columnheader(2), \
'' index i u 0:3:(dx) w xerr lc "red" lw 3 ps 0 ti columnheader(3), \
x1=y1=NaN '' index i u (x0=x1,x1=$0,x0-1+dx):(y0=y1,y1=$2,y0):(1-2*dx):(y1-y0) w vec dt 4 lc "blue" nohead, \
x1=y1=NaN '' index i u (x0=x1,x1=$0,x0-1+dx):(y0=y1,y1=$3,y0):(1-2*dx):(y1-y0) w vec dt 4 lc "red" nohead
}
set output # close the last file
### end of script
使用的数据
"Reaction Coordinate" "0 V" "0.40 V" "FeZn (7, 9)"
O_{2} 0.00 -2.29
O@^*_{2} -0.03 -2.31
OOH^* -1.05 -3.51
O^* -1.54 -4.18
OH^* -4.30 -4.92
H_{2}O -4.92 -4.92
"Reaction Coordinate" "0 V" "0.30 V" "FeZn (1, 9)"
O_{2} 0.00 -2.29
O@^*_{2} -0.03 -2.21
OOH^* -1.05 -3.51
O^* -1.54 -4.18
OH^* -4.30 -4.92
H_{2}O -4.92 -4.92