Graph gnuplot:标记/突出显示区域(线条图的一部分)
我的数据非常简单,只有一个时间戳和一个如下数字:Graph gnuplot:标记/突出显示区域(线条图的一部分),graph,gnuplot,highlight,area,Graph,Gnuplot,Highlight,Area,我的数据非常简单,只有一个时间戳和一个如下数字: 2013-01-23 08:27:55 2801 2013-01-23 08:33:13 2801 2013-01-23 08:38:31 2660 2013-01-23 08:43:49 2785 2013-01-23 08:49:07 2785 我从另一个系统获取数据。日期和时间之间的间距,以及“日期-时间”和数字之间的制表符 整个时间窗口只有几个小时。。几天。这个总的时间窗口包含一个或多个有趣的部分(通常是几个小时),我想以某种方式标记
- 2013-01-23 08:27:55 2801
- 2013-01-23 08:33:13 2801
- 2013-01-23 08:38:31 2660
- 2013-01-23 08:43:49 2785
- 2013-01-23 08:49:07 2785
function my_gnuplot {
if [ $# -ne 3 -o -z "$1" -o -z "$2" -o -z "$3" ]
then
echo $0 $FUNCNAME Invalid parameters, exiting
exit 3
fi
sid="$1" ; shift
stime="$1" ; shift
etime="$1" ; shift
if [ $sid -gt 0 -a $sid -lt 10 ]
then
title=0$sid
else
title=$sid
fi
gnuplot <<- EOF
reset
set terminal png size 1800,900 enhanced font myfont.ttf 10
set xdata time
set timefmt "%Y-%m-%d %H:%M:%S"
set format x "%Y-%m-%d %H:%M"
set title "SID=$title from $stime to $etime"
set grid
set xrange [ "$stime" : "$etime" ]
set yrange [ -2000 : 6000 ]
set style data linespoints
plot "sid_data_$sid.txt" using 1:9 notitle
EOF
}
函数my\u gnuplot{
如果[$#-ne 3-o-z“$1”-o-z“$2”-o-z“$3”]
然后
echo$0$FUNCNAME无效参数,正在退出
出口3
fi
sid=“$1”移位
stime=“$1”移位
etime=“$1”班次
如果[$sid-gt 0-a$sid-lt 10]
然后
title=0$sid
其他的
title=$sid
fi
gnuplot您可以很容易地使用矩形填充空间:
set xdata time
set timefmt '%Y-%m-%d %H:%M:%S'
set object 1 rectangle from "2013-01-23 08:33:13",graph 0 to "2013-01-23 08:43:49",graph 1 fs solid fc rgb "red" behind
plot 'test.dat' u 1:3 w lines ls -1
非常感谢!正是我想要的!
set xdata time
set timefmt '%Y-%m-%d %H:%M:%S'
set object 1 rectangle from "2013-01-23 08:33:13",graph 0 to "2013-01-23 08:43:49",graph 1 fs solid fc rgb "red" behind
plot 'test.dat' u 1:3 w lines ls -1