【发布时间】:2014-05-20 00:13:29
【问题描述】:
我想绘制一个随时间变化的堆积直方图。事实证明这与Using gnuplot for stacked histograms 不同。
这是数据:
05/11/2014 10:00:00 1 5 1
05/12/2014 22:00:00 3 5 1
05/13/2014 13:00:00 4 4 1
05/14/2014 09:00:00 3 4 1
05/15/2014 04:00:00 1 2 1
前两列由空格分隔,其余列由制表符分隔。 x 轴应该是日期和时间。
下面的gnuplot脚本有问题:
set title "Test"
set key invert reverse Left outside
set key autotitle columnheader
set style data histogram
set style histogram rowstacked
set style fill solid border -1
set boxwidth 0.75
set datafile separator '\t'
set xdata time
set timefmt '%M/%D/%Y %H:%M:%S'
set format x '%M/%D %H'
plot 'test.dat' using 2:xtic(1) title 'Col1', '' using 3 title 'Col2', '' using 4 title 'Col3'
上面的脚本会导致错误:Need full using spec for x time data。但是,如果未设置 xdata,它会起作用。
【问题讨论】:
标签: gnuplot