绘制直方图&x2B;Gnuplot中的linespoints

绘制直方图&x2B;Gnuplot中的linespoints,gnuplot,histogram,Gnuplot,Histogram,我想将柱状图中选定的条形图与线条点连接起来。现在 我在Gnuplot中使用以下代码创建了直方图: set terminal postscript eps enhanced colour font 'Times-Roman,12' size 6in,4in set output "LS_Figure_Histogram_New_2019_III.eps" set xtics out scale 1.5 set ytics out scale 1.5 set y2tics out scale

我想将柱状图中选定的条形图与线条点连接起来。现在

我在Gnuplot中使用以下代码创建了直方图:

set terminal postscript eps enhanced colour font 'Times-Roman,12' size 6in,4in  
set output "LS_Figure_Histogram_New_2019_III.eps"

set xtics out scale 1.5 
set ytics out scale 1.5
set y2tics out scale 1.5 
set ytics nomirror
set yrange [-3.50:-3.70]
set y2range [0:45] 
set key off
set tics font ", 14"
set xlabel "Experiment No." font ",16"
set ylabel "Li^{+}|Li vs. Cl^{-}|Cl_{2} (V)" font ",16"
set y2label "Residual Current Density (mA/cm^{2})" font ",16"
set key autotitle columnheader
set key inside left horizontal
set style fill solid 1.00 noborder
set style histogram clustered gap 1 title textcolor lt -1


set style data histograms
plot 'LS_Histogram_Comp_2019.dat' using 2:xtic(1) ls 2 ti col axis x1y1, '' u 3:xticlabels(1) ls 4 ti col axis x1y2
数据文件如下所示

# Histogram_Comparison of onset potential & Residual current density
Experimental "Li^{+}|Li (V)" "Res. Current Density (mA/cm^{2})" 
1   -3.64469    31.3
2   -3.65257    11.2
3   -3.66159    32.39
4   -3.66536    13.41
5   -3.66314    16.3
6   -3.64556    10.3
7   -3.64383    10.08
8   -3.63042    9.96
9   -3.65344    9.59
10  -3.64383    8.44
11  -3.64859    11.1
12  -3.63919    27.6
13  -3.64204    9.78
14  -3.62692    30.96
15  -3.64348    18.22
16  -3.6362         32.05
17  -3.62831    20.1
18  -3.62984    42.32
19  -3.63764    24.8
我希望使用linespoints连接对应于实验12、14、16和18(使用第1列和第3列数据)的条,以及对应于实验13、15、17和19(使用第1列和第3列数据)的条

有没有办法在Gnuplot中实现这一点?

试试这个

set terminal postscript eps enhanced colour font 'Times-Roman,12' size 6in,4in  
set output "LS_Figure_Histogram_New_2019_III.eps"

set xtics out scale 1.5 
set ytics out scale 1.5
set y2tics out scale 1.5 
set ytics nomirror
set yrange [-3.50:-3.70]
set y2range [0:45] 
set key off
set tics font ", 14"
set xlabel "Experiment No." font ",16"
set ylabel "Li^{+}|Li vs. Cl^{-}|Cl_{2} (V)" font ",16"
set y2label "Residual Current Density (mA/cm^{2})" font ",16"
set key autotitle columnheader
set key inside left horizontal
set style fill solid 1.00 noborder
set style histogram clustered gap 1 title textcolor lt -1
# ----------------------------------------
set rmargin screen 0.9
set lmargin screen 0.1
set bmargin screen 0.1
set multiplot
# ----------------------------------------
set style data histograms
plot 'LS_Histogram_Comp_2019.dat' using 2:xtic(1) ls 2 ti col axis x1y1, '' u 3:xticlabels(1) ls 4 ti col axis x1y2
# ----------------------------------------
unset tics
unset xlabel
unset ylabel
unset y2label
set xrange [0:20]
set yrange [0:45]
plot 'LS_Histogram_Comp_2019.dat' \
        skip 12 every 2 using 1:3 w linespoints ls 1 lw 4 not,\
     '' skip 13 every 2 using 1:3 w linespoints ls 3 lw 4 not
结果