Gnuplot 带有错误条的直方图,带有列标题的pb

Gnuplot 带有错误条的直方图,带有列标题的pb,gnuplot,Gnuplot,这些是我的数据:表11mol+func.dat #mol PBE optPBE optB86b BEEF Exp IncertitudeBEEF 0 0 PBE-PBE optPBE-vdW1 optB86b-vdW1 BEEF-vdW2 Exp Incert.BEEF 0 1 0.014 0.226 0.210 0.125 0.155

这些是我的数据:表11mol+func.dat

#mol  PBE     optPBE        optB86b       BEEF       Exp      IncertitudeBEEF    0 
0    PBE-PBE  optPBE-vdW1  optB86b-vdW1  BEEF-vdW2  Exp       Incert.BEEF        0
1    0.014   0.226         0.210         0.125     0.155          0.10444        0  
2    0.033   0.362         0.392         0.223      0             0.16794        0
3    1.742   1.755         2.152         1.432     1.36             0.29116      0
4    1.206   1.441         1.724         1.115      0             0.17857        0
5    0.934   1.533         1.857         1.063       0            0.30034        0
6    0.777   1.514         1.843         0.959     1.295            0.31264      0
7    2.018   2.298         2.858         1.751       0             0.37737       0
8    1.084   1.648         2.336         1.033     1.762            0.60643      0
9    1.504   2.355         3.451         1.449     2.694            1.0138       0
这是我的代码:

set key left
set auto x
set ylabel "- E_{ads} (eV)" font "Times-Roman, 18"
set yrange [0:3.5]
set ytics (0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5) font "Times-Roman, 18"
set style data histograms
set style histogram errorbars lw 1
set style fill solid border -1
set boxwidth 0.9
set xtics ("Methane" 0, "Ethane" 1, "Ethylidyne" 2, "Ethylene" 3, "Butene" 4,  "Cyclohexene" 5, "Butadiene" 6, "Benzene" 7, "Naphtalene" 8) font "Times-Roman, 15"
set xtic nomirror rotate by -45 scale 0 
set grid y
plot 'TABLE11-mol+func.dat' using 2:8 ti col, '' u 3:8 ti col, '' u 4:8 ti col, '' u 5:7 ti col, '' u 6:8 ti col
这会为每种颜色提供一个标题错误的直方图

所以我试着用这一行而不是最后一行来“用我的手”添加它们:

plot 'TABLE11-mol+func.dat' using 2:8 ti 'PBE', '' u 3:8 ti 'optPBE', '' u 4:8 ti 'optB86b', '' u 5:7 ti 'BEEF', '' u 6:8 ti 'Exp'
这弄乱了我的柱状图,奇怪的东西出现在整个图表中,它添加了一个xtic和条形图

有人能帮我吗


更奇怪的是,它在几个月前就开始工作了。。。也许是因为我有一个新版本的gnuplot

Gnuplot无法选择从中获取标题的正确列。它尝试始终使用第8列,如使用选项中的第二列所示,尽管这会给出误差估计值,而不是y值。您必须明确给出列号,例如
ti col(3)


好的,我明白了。但是现在它不喜欢命令“lot”:gnuplot>lot for[i=2:6]“table11mol+func.dat”使用i:8ti col(i)^“table11mol+func stackof.gnu”,第11行:无效的命令,复制粘贴错误。当然应该是
绘图…
,请参阅更新。好的,谢谢!它可以工作,但不再给我错误条。迭代是错误的,因为你使用不同的列作为错误条。我更新了答案。通过这个,它终于可以了:使用2:8 ti col(2),'u 3:8 ti col(3),'u 4:8 ti col(4),'u 5:7 ti col(5),'u 6:8 ti col(6)绘制“TABLE11 mol+func justEads.dat”
set key left
set yrange [0:3.5]
set ytics 0.5
set style data histograms
set style histogram errorbars lw 1
set style fill solid border -1
set boxwidth 0.9
set xtics ("Methane" 0, "Ethane" 1, "Ethylidyne" 2, "Ethylene" 3, "Butene" 4,  "Cyclohexene" 5, "Butadiene" 6, "Benzene" 7, "Naphtalene" 8)
set xtic nomirror rotate by -45 scale 0 
set grid y
plot 'TABLE11-mol+func.dat' u 2:8 t col(2), '' u 3:8 t col(3), '' u 4:8 t col(4), '' u 5:7 t col(5), '' u 6:8 t col(6)