【问题标题】:How to show median line on top of如何在顶部显示中线
【发布时间】:2016-04-08 18:17:29
【问题描述】:

我有一个方便的脚本,它正在运行ab 并在之后生成情节。但是有一个问题,它向我展示了每一点(这很好),但是我也希望看到它们之间的平均“线”。我会在图片中展示更多内容。

那么有没有办法在顶部添加中值/中值游侠?

脚本

#!/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

输出

输出(我想要的)

【问题讨论】:

    标签: gnuplot


    【解决方案1】:

    这可以通过smooth unique 选项来完成:

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

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

    【讨论】:

    • 谢谢。你也碰巧知道如何让线条变粗吗?
    • plot ... linewidth 2
    猜你喜欢
    • 2019-06-12
    • 1970-01-01
    • 2015-10-23
    • 2021-03-15
    • 2012-11-26
    • 2014-08-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多