使用x轴上的日期的gnuplot股票图表

时间:2017-11-04 08:36:25

标签: gnuplot

我第一次尝试使用gnuplot。 我是gnuplot的新手。请原谅任何基本错误。 我正在尝试绘制股票图表。 我的数据如下所示:

Date Open High Low Close
21/04/2017 31.81 32.09 31.67 31.95
20/04/2017 31.55 32.02 31.45 31.91
19/04/2017 31.3 31.71 30.99 31.57
18/04/2017 31.78 31.84 31.06 31.3
17/04/2017 31.3 31.97 31.21 31.8
13/04/2017 31.26 31.48 31.16 31.19
12/04/2017 31.13 31.38 30.98 31.24
11/04/2017 31.37 31.66 30.86 31.2

我使用以下设置绘制线条。我是从其他网站上获得的。

set xdata time
set timefmt "%d/%m/%Y"
set xrange ["21/04/2015":"21/04/2017"]
set format x "%d/%m/%Y"
plot [0:100] 'chart.dat' using 0:2:3:4:5 notitle with financebars

然而,x轴只是01/01/1970。见附图。 chart.png

非常感谢任何帮助。感谢。

1 个答案:

答案 0 :(得分:1)

绘图命令plot [0:100] ... using 0:2:3:4:5的第0列为x,第0列对应行号而不是时间列。

此命令应该有效:

plot 'chart.dat' using 1:2:3:4:5 notitle with financebars