我有以下csv
文件,其中列分别代表hour
,minute
,view count
,每天的每分钟恰好有1440个条目。我想用gnuplot
绘制它。 (由于MySQL只有完整的GROUP BY,因此无法将HH:MM放入一列。)
"0","0","71"
"0","1","55"
"0","2","56"
...
"23","57","66"
"23","58","70"
"23","59","75"
目前我使用以下命令:
set datafile separator ","
set timefmt "%H,%M"
set xdata time
set xtics format "%H:%M" time font "/:normal,8" rotate by 45 offset -1,-1
时间格式未正确呈现,小时数被解释为分钟,并且根本不显示分钟。
我也尝试set timefmt "\"%H\",\"%M\""
但没有成功。
两个问题:
using 0:n
plot
?答案 0 :(得分:1)
使用此时间格式字符串
set timefmt "%H:%M"
将此功能放在某处:
catdate(x,y)=sprintf("%d:%d",x,y)
然后用:
绘图plot 'data.dat' u (catdate($1,$2)):($3) w l