2017-09-01 15 views
1

私はPostgreSQLで生成されたこのデータをプロットしたい次のスクリプトx範囲が無効です。たぶんはtimefmt間違っ

set datafile separator "," 
set grid 

set autoscale 

set timefmt "%y-%m-%d %H:%M:%S" 
set xdata time 

plot 'test.txt' using 1:2 with lines 

データ

2017-09-01 13:15:29,615,668 
2017-09-01 13:15:29,615,666 
2017-09-01 13:15:29,614,666 
2017-09-01 13:15:29,615,666 
2017-09-01 13:15:29,615,665 
2017-09-01 13:19:52,614,660 
2017-09-01 13:19:52,615,661 

を持っています。時間が経ってからなぜ私は理解できないのですか

gnuplot> plot 'test.txt' using 1:2 with lines 
              ^
     "strom-plot.txt", line 9: x range is invalid 

何かヒントはありがたいです。

編集:私はgnuplotの5.0パッチレベル5 Debianのストレッチ

答えて

2

問題があなたのtimefmt引数に誤りであるにしています。 %yの代わりに%Yを使用する必要があります。 help timefmtから:

Format  Explanation 
%y   year, 0--99 
%Y   year, 4-digit 

これは、ここに動作します:

set datafile separator "," 
set grid 

set autoscale 

set timefmt "%Y-%m-%d %H:%M:%S" 
set xdata time 

plot 'test.txt' using 1:2 with lines 

結果:

Plot of first and second columns

+0

おかげで、私が持っていた同じエラーメッセージ、および追加 'セットのデータ・ファイルのセパレータを"、"それを修正しました。 – Cheeso

関連する問題