Gnuplot和“悬挂”栏

时间:2019-02-05 21:13:09

标签: gnuplot

在Gnuplot中,是否可以绘制类似这样的图形?条形,从一列的一点开始,到另一列的一点结束?

给出此示例数据,例如:

set datafile separator "/"
$Z <<EOD
2017-08-11 07:00/12/32/65
2017-08-12 06:52/13/36/62
2017-08-13 08:08/11/31/63
2017-08-13 23:04/12/39/56
2017-08-14 07:28/12/31/58
2017-08-15 06:59/10/36/65
2017-08-15 23:55/12/33/56
2017-08-16 08:33/12/37/63
2017-08-16 23:13/14/39/70
2017-08-17 07:47/11/31/58
EOD

1 个答案:

答案 0 :(得分:1)

多种方法,具体取决于您所说的“酒吧”是什么意思

set xdata time
set timefmt "%Y-%m-%d %H:%M"
set yrange [0:100]

# Thick lines as "bars"
plot $Z using 1:3:(0):($4-$3) with vectors nohead lw 6

# boxes of width 2 hour ( +/- 3600 seconds)
set style fill solid 0.5 border lc "black"
plot $Z using 1:3:(timecolumn(1)-3600.):(timecolumn(1) + 3600.):3:4 with boxxy

with vectors with boxxy