Date Gnuplot上x轴处具有日期格式的堆叠区域

Date Gnuplot上x轴处具有日期格式的堆叠区域,date,graph,gnuplot,Date,Graph,Gnuplot,我已经用filledcurves创建了图形。现在,图表看起来很糟糕,因为数据范围很长。 这是我的数据: a b c d e f g h i 201312 49 26 34 30 14 25 9 4 1 201311 38 22 47 30 9 9 4 3 1 201310 44 24 43 38 9 14 5 7 0 201309 65 18 33 39 15 12

我已经用filledcurves创建了图形。现在,图表看起来很糟糕,因为数据范围很长。 这是我的数据:

        a   b   c   d   e   f   g   h   i
201312  49  26  34  30  14  25  9   4   1
201311  38  22  47  30  9   9   4   3   1
201310  44  24  43  38  9   14  5   7   0
201309  65  18  33  39  15  12  4   5   1
201308  42  31  44  30  5   11  0   2   2
201307  58  27  35  29  8   4   2   4   2
201306  30  22  15  17  2   6   3   4   0
201305  61  52  20  16  11  12  2   3   0
201304  62  60  33  18  13  9   5   6   0
201303  43  53  49  27  9   11  7   0   0
201302  31  30  42  27  10  8   4   2   0
201301  42  30  20  47  9   13  3   2   1
201212  26  19  39  24  9   11  0   0   0
201211  26  26  30  28  1   2   0   2   1
201210  55  46  34  30  13  5   0   2   1
201209  56  31  27  28  27  13  2   4   1
201208  48  75  38  46  22  10  0   1   0
201207  60  56  37  47  19  11  2   1   0
201206  60  41  37  28  17  12  5   1   0
201205  49  43  38  46  15  16  2   2   0
201204  43  50  36  33  4   7   3   0   2
201203  49  63  35  43  16  7   1   2   0
201202  43  59  59  52  16  13  3   4   1
201201  51  44  30  37  20  9   4   1   0
201112  50  38  36  36  8   2   3   1   1
201111  75  35  30  36  16  7   3   3   1
201110  68  53  41  27  11  15  1   2   1
201109  68  46  48  47  16  19  4   0   1
201108  45  41  20  36  17  10  1   0   0
201107  48  34  30  24  13  7   3   3   1
201106  49  29  24  25  5   6   0   3   0
201105  45  35  21  37  1   7   2   1   0
201104  53  35  23  18  4   6   1   5   1
201103  58  42  20  18  6   4   1   0   4
201102  54  32  19  20  4   10  0   2   0
201101  42  41  21  28  3   6   1   2   1
这是我的gnuplot文件:

set terminal postscript eps color font 20
set xtics 1 out
set tics front
#set style fill transparent solid 0.5 noborder
set key below autotitle columnheader
set ylabel "Count"
set xlabel "across time"

set output 't1.eps'
set title "t1-Across time of Aspects"
set xtics 1
plot for [i=10:2:-1] \
"< awk 'NR==1 {print \"year\",$".(i-1)."} NR>=2 {for (i=2; i<=".i."; i++) \
{sum+= $i} {print $1, sum; sum=0} }' data.dat" \
using (column(2)):xtic(1) with filledcurves x1 t column(2)
Erros消息:

Need full using spec for x time data

这些错误是因为我的日期格式吗?我在谷歌上搜索过这个,没有任何答案。请给我一些建议。

在您显示的脚本中,您使用语句(除了
xtic
)在
中只指定了一列。这意味着,该值被视为y值,行号被隐式地用作x值

使用时间数据时,必须明确指定打印样式所需的所有列,而不必假设第一列可能是什么。使用:

set key below autotitle columnheader
set ylabel "Count"
set xlabel "across time"
set tics front

set xdata time
set timefmt "%Y%m"
set xtics format "%b'%y"
set autoscale xfix

plot for [i=10:2:-1] \
"< awk 'NR==1 {print \"year\",$".(i-1)."} NR>=2 {for (i=2; i<=".i."; i++) \
{sum+= $i} {print $1, sum; sum=0} }' data.dat" \
using 1:2 with filledcurves x1 t column(2)
设置自动字幕栏标题下方的键
设置标签“计数”
设置xlabel“跨时间”
摆在前面
设置扩展数据时间
设置时间表“%Y%m”
设置xtics格式“%b”%y
设置自动缩放xfix
[i=10:2:-1]的绘图\

=2{for(i=2;iI)在我的数据超过12时也会出错,我如何显示范围为3年的年份?您的较大数据集与我发布的脚本配合得很好,请参见我答案中的更新图像。如何在x轴中添加年份,即1月11日、4月12日,甚至是我设置的时间格式timemt”%Y%m,x轴仍显示完整数据01-01-2011或设置格式为x“%b”%y“
有关较短字符串,请参阅更新。
set key below autotitle columnheader
set ylabel "Count"
set xlabel "across time"
set tics front

set xdata time
set timefmt "%Y%m"
set xtics format "%b'%y"
set autoscale xfix

plot for [i=10:2:-1] \
"< awk 'NR==1 {print \"year\",$".(i-1)."} NR>=2 {for (i=2; i<=".i."; i++) \
{sum+= $i} {print $1, sum; sum=0} }' data.dat" \
using 1:2 with filledcurves x1 t column(2)