Gnuplot组日期(按年/月)

Gnuplot组日期(按年/月),gnuplot,Gnuplot,是我第一次使用gnuplot,我的数据文件data.csv包含以下内容 2017-05-28,50000 2017-07-13,100 2017-07-14,3217 2017-01-23,2052 2017-01-24,1954 2017-01-25,1664 现在我尝试使用以下设置进行绘图 set title 'My First Graph' set ylabel 'Total per day' set xlabel 'Date' set grid set term png set dat

是我第一次使用gnuplot,我的数据文件
data.csv
包含以下内容

2017-05-28,50000
2017-07-13,100
2017-07-14,3217
2017-01-23,2052
2017-01-24,1954
2017-01-25,1664
现在我尝试使用以下设置进行绘图

set title 'My First Graph'
set ylabel 'Total per day'
set xlabel 'Date'
set grid
set term png
set datafile separator ","
set output 'graph.png'
set timefmt '%Y-%m-%d'
set format x "%Y-%m"
plot 'data.csv'

首先,我得到了一个
第10行:格式错误的字符
,我不理解它

您需要添加
设置扩展数据时间
绘图
,并明确指定两列:

set title 'My First Graph'
set ylabel 'Total per day'
set xlabel 'Date'
set grid
set datafile separator ","
set timefmt '%Y-%m-%d'
set format x "%Y-%m"
set xdata time
plot 'data.csv' using 1:2
给予