2014-07-23 68 views
1

我有几个字段的文件:与gnuplot的绘制时间数据

$ cat report.txt 
2014-04-18T14:21:19 41 33 
2014-04-21T02:01:35 42 36 
2014-05-14T16:47:58 36 57 
2014-05-19T01:01:30 37 58 
2014-05-23T01:25:06 41 59 
2014-07-23T11:54:48 34 76 

我想渲染使用的gnuplot它的图形,呈现,如:

所以基本上

  • X轴:字段1(T之前)
  • Y轴:从场2和3
  • 蓝色值:场2
  • 价值红色:场3

的价值我错过如何做到这一点的gnuplot基本的了解。我已经阅读了manpage,一些在线文档和示例,但仍然无法弄清楚如何做这样的简单图表。

+0

我编辑了标题,以反映你的问题是什么,希望你答应。我没有检查我的答案中的颜色,但那不难实现。 – kebs

回答

2

这将做到这一点(4.6测试):

set xdata time 
set yrange [0:70] 

# input date format 
set timefmt "%Y-%m-%dT%H:%M:%S" 

# output date format 
set format x "%Y\n%m-%d" 

plot \ 
    'report.txt' using 1:2 with lines ti "col 2", \ 
    'report.txt' using 1:3 with lines ti "col 3"