2014-07-23 84 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"