如何在上方显示中线 [英] How to show median line on top of

查看:92
本文介绍了如何在上方显示中线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个方便的脚本,正在运行ab并随后生成绘图.但是有一个问题,它向我显示了每个点(很好),但是我也希望看到它们之间的平均线".我将在图片中显示更多.

I have a handy script that is running ab and generating plot afterwards. However there is a problem, it shows me every point (which is good), however I would like to see also the average "line" between them. I will show more in the picture.

那么有什么方法可以在顶部添加中值/中值护林员?

So is there any way to add the median/medium ranger on top?

#!/usr/local/bin/gnuplot

set terminal jpeg size 1280,720
set size 1, 1
set output OUTPUT
set title OUTPUT
set key left top
set grid y
set xdata time
set timefmt "%s"
set format x "%S"
set xlabel 'seconds'
set ylabel "response time (ms)"
set datafile separator '\t'
plot INPUT every ::2 using 2:5 title 'response time' with points
exit

输出

推荐答案

可以通过

That can be done with the smooth unique option:

这使得数据在x中是单调的;具有相同x值的点将替换为 具有平均y值的单个点.然后将所得的点通过直线段连接起来.

This makes the data monotonic in x; points with the same x-value are replaced by a single point having the average y-value. The resulting points are then connected by straight line segments.

plot INPUT every ::2 using 2:5 title 'response time' with points,\
     '' every ::2 using 2:5 smooth unique title 'average' with lines

这篇关于如何在上方显示中线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆