随时间变化的 gnuplot 事件频率
gnuplot event frequency over time
我有一个鸟舍,每次有鸟进入或离开时,我都会通过摄像机运动检测收集时间戳。现在我有大量时间戳,格式如下:
2019-06-19-08:14:17
2019-06-19-08:16:59
2019-06-19-08:18:11
2019-06-19-08:20:44
2019-06-19-08:20:59
2019-06-19-08:25:33
2019-06-19-08:26:03
...
超过 3 天,我想想象一下这些天的 "bird traffic" 可以说,"Oh, at 2 o'clock is a lot of bird traffic..."。
到目前为止我尝试的是一个非常基本的非功能脚本:
set terminal pngcairo size 800,400 enhanced font 'Verdana,10' linewidth 1
set output 'birds.png'
set xdata time
set timefmt "%Y-%m-%d-%H:%M:%S"
set format x "%H:%M"
set xtics nomirror rotate by -45 font 'Verdana-Bold,10'
set ytics font 'Verdana-Bold,10'
set xrange ["2019-06-19-08:14:17":"2019-06-23-18:27:17"]
plot 'events.log'
我知道这可能与 "smooth freq" 和以某种方式合并数据有关,但我不知道该怎么做。
有什么想法吗?
set xdata time
set timefmt "%Y-%m-%d-%H:%M:%S"
set format x "%H:%M"
bin_width=120
bin(t) = (t - (int(t) % bin_width))
set boxwidth 100
plot [] [0:3] 'events.log' u (bin(timecolumn(1, "%Y-%m-%d-%H:%M:%S"))):(1.0) smooth freq with boxes
(找到解决方案 here)
我有一个鸟舍,每次有鸟进入或离开时,我都会通过摄像机运动检测收集时间戳。现在我有大量时间戳,格式如下:
2019-06-19-08:14:17
2019-06-19-08:16:59
2019-06-19-08:18:11
2019-06-19-08:20:44
2019-06-19-08:20:59
2019-06-19-08:25:33
2019-06-19-08:26:03
...
超过 3 天,我想想象一下这些天的 "bird traffic" 可以说,"Oh, at 2 o'clock is a lot of bird traffic..."。
到目前为止我尝试的是一个非常基本的非功能脚本:
set terminal pngcairo size 800,400 enhanced font 'Verdana,10' linewidth 1
set output 'birds.png'
set xdata time
set timefmt "%Y-%m-%d-%H:%M:%S"
set format x "%H:%M"
set xtics nomirror rotate by -45 font 'Verdana-Bold,10'
set ytics font 'Verdana-Bold,10'
set xrange ["2019-06-19-08:14:17":"2019-06-23-18:27:17"]
plot 'events.log'
我知道这可能与 "smooth freq" 和以某种方式合并数据有关,但我不知道该怎么做。 有什么想法吗?
set xdata time
set timefmt "%Y-%m-%d-%H:%M:%S"
set format x "%H:%M"
bin_width=120
bin(t) = (t - (int(t) % bin_width))
set boxwidth 100
plot [] [0:3] 'events.log' u (bin(timecolumn(1, "%Y-%m-%d-%H:%M:%S"))):(1.0) smooth freq with boxes
(找到解决方案 here)