Datetime 与gnuplot战斗以使方框图正常工作

Datetime 与gnuplot战斗以使方框图正常工作,datetime,gnuplot,Datetime,Gnuplot,我有一个包含以下列的数据文件: Year:Month Data1 Data2 Data3 对于给定的日期范围(例如,去年),我想使用方框进行绘制,因此每个月有3个方框并排排列(每个1/3为一个完整的月宽),分别用于Data1、Data2和Data3。但我不能让gnuplot玩。以下是我尝试过的: set xdata time set timefmt "%Y:%m" set style fill solid set boxwidth 890000 absolu

我有一个包含以下列的数据文件:

Year:Month    Data1    Data2   Data3
对于给定的日期范围(例如,去年),我想使用方框进行绘制,因此每个月有3个方框并排排列(每个1/3为一个完整的月宽),分别用于Data1、Data2和Data3。但我不能让gnuplot玩。以下是我尝试过的:

set xdata time
set timefmt "%Y:%m"
set style fill solid
set boxwidth 890000 absolute # Third of a month in seconds, approx
plot ["2020:02" : "2021:02"][0:] "file.dat" using 1:2 with boxes, "file.dat" using ($1 - 890000):3 with boxes, "file.dat" using ($1 + 890000):4 with boxes
我担心我误解了“使用1:2”和“使用($1+…):2”之间的区别,但不确定如何-生成的绘图具有正确的Y比例/值,但X比例到处都是。

使用($1)不尊重时间格式。尝试使用(时间列(1,“%Y:%m”)代替

plot ["2020:02" : "2021:02"][0:] "file.dat" using 1:2 with boxes, \
                                 "file.dat" using (timecolumn(1, "%Y:%m")-890000):3 with boxes, \
                                 "file.dat" using (timecolumn(1, "%Y:%m")+890000):4 with boxes