2014-12-02 48 views
1

爲什麼以下不起作用? (在所述柱的底部CF誤差)Gnuplot datetime格式不起​​作用

set terminal dumb 
set style data lines 

set datafile separator "," 
set timefmt "%Y-%m-%d %H:%M:%S" 

set xdata time 
set xrange ['"2014-12-01 00:00:00"':'"2014-12-03 00:00:00"'] 

set format x "%m-%d\n%H:%M" 

plot "<cat" using 1:2 

數據:

2014-12-02 13:59:35,1 
2014-12-02 13:59:57,2 
2014-12-02 14:00:37,3 
2014-12-02 14:00:43,4 
2014-12-02 14:01:03,5 
2014-12-02 14:01:22,6 
2014-12-02 14:01:32,7 
2014-12-02 14:01:37,8 
2014-12-02 14:02:27,9 
2014-12-02 14:04:18,10 

輸出:

Can't plot with an empty x range! 

回答

1

的問題是在雙引號單引號的內部。你不需要他們兩個。

set xrange ['2014-12-01 00:00:00':'2014-12-03 00:00:00'] 
plot "<cat" using 1:2 

輸出:

10 ++-+--+--+--+--+--+-+--+--+--+--+--+--+--+--+--+--+--+-+*-+--+--+--+-++ 
    +  +  +  +  +  +"1.dat" using 1:2 ****** + 
    9 ++              *    ++ 
    |              *    | 
    8 ++              *    ++ 
    |              *    | 
    7 ++              *    ++ 
    |              *    | 
    6 ++              *    ++ 
    |              *    | 
    5 ++              *    ++ 
    |              *    | 
    4 ++              *    ++ 
    |              *    | 
    3 ++              *    ++ 
    |              *    | 
    2 ++              *    ++ 
    +  +  +  +  +  +  + *  +  + 
    1 ++-+--+--+--+--+--+-+--+--+--+--+--+--+--+--+--+--+--+-*--+--+--+--+-++ 
    12-01 12-01 12-01 12-01 12-02 12-02 12-02 12-02 12-03 
    00:00 06:00 12:00 18:00 00:00 06:00 12:00 18:00 00:00 
+0

Aaargh。謝謝。 – 2014-12-02 16:58:51