Gnuplot——在散点图的适当位置显示平均值

Gnuplot——在散点图的适当位置显示平均值,gnuplot,Gnuplot,在Gnuplot 5.4(在Big Sur上)中,我有两列数据显示为散点图。添加第二列的平均值将在y轴上的适当值处生成一条水平线。但是,第一列的平均值也在y轴上的值处显示为水平线。是否可以将其显示为x轴上适当值处的垂直线 stats 'sleep.dat' using 1 name "A" stats 'sleep.dat' using 2 name "B" set xlabel "Hours" set ylabel "Eve

在Gnuplot 5.4(在Big Sur上)中,我有两列数据显示为散点图。添加第二列的平均值将在y轴上的适当值处生成一条水平线。但是,第一列的平均值也在y轴上的值处显示为水平线。是否可以将其显示为x轴上适当值处的垂直线

stats 'sleep.dat' using 1 name "A"
stats 'sleep.dat' using 2 name "B"
set xlabel "Hours"
set ylabel "Events"
set title "Apnea Events/Hours of Sleep"
set xrange [3:9]
set yrange [0:4]
set xtics 0.5
set ytics 0.25
plot 'sleep.dat' lc 9 lw 5, A_mean lw 2, B_mean lw 2

要从图形的顶部到底部绘制垂直线,实际上可以使用无头的
箭头

set arrow from B_mean, graph 0 to B_mean, graph 1 nohead

欢迎来到stackoverflow。当问此类问题时,请显示用于生成所问绘图的命令。在某些情况下,如果您提供了样本数据和/或图像文件或不满意输出的屏幕截图,也可能对受访者有所帮助。在目前的情况下,我们不知道您做了什么来产生您所描述的输出,因此很难提出更改建议。
set arrow from B_mean, graph 0 to B_mean, graph 1 nohead