gnuplot 使用时间序列 csv 数据

gnuplot using time series csv data

我正在尝试从 csv 文件 'data.csv' 中绘制价格数据与时间的关系图,格式如下:

DateTime,Price,Size
2015-04-16 07:49:24.335,129.68,248
2015-04-16 07:49:24.385,129.68,278
2015-04-16 07:49:24.435,129.68,182
2015-04-16 07:49:25.485,129.68,2
2015-04-16 07:49:26.235,129.68,20

但是我正在尝试这个:

set xdata time
set timefmt '%Y%m%d %H:%M:%S'
plot "G:\data.csv" using 0:2 notitle with lines

得到错误的图表。我试过使用用户指南无济于事

有人可以帮忙吗?

两件事:列编号从 1 开始,您必须告诉 gnuplot 使用逗号作为列分隔符:

set xdata time
set timefmt '%Y-%m-%d %H:%M:%S'
set datafile separator ','
plot "G:\data.csv" using 1:2 notitle with lines