我有一個看起來像這樣的文件:情節從晚上11點到早上9點的時間數據,可以追溯到
[email protected] asc-47$ head -n 2 imp
23:22:37 23.3769 240.800 581.300 1.000 1.000 -2.839 -0.360 5.114 2.076
23:23:07 23.3853 240.700 580.300 1.000 1.000 -2.838 -0.358 5.114 2.079
[email protected] asc-47$ tail -n 2 imp
09:22:23 9.3731 257.300 636.900 1.000 1.000 -2.867 -0.358 5.103 2.082
09:22:53 9.3814 257.200 635.800 1.000 1.000 -2.867 -0.358 5.104 2.082
我想繪製列3列VS 1.
我gnuplot的文件看起來像這樣:
#!/bin/gnuplot
#
set terminal svg size 1400,1048 enhanced fname 'Verdana' fsize 12
set output 'curr-imp.svg'
unset key
set xlabel 'Tiempo (h)'
set ylabel 'Corriente (mA)'
set xdata time
set timefmt "%H:%M:%S"
set format x "%H"
set style line 1 lc rgb '#000000' pt 6 ps 1 lt 1 lw 2 # --- black with empty circles
set style line 11 lc rgb '#808080' lt 1
set border 3 back ls 11
set tics nomirror
set style line 12 lc rgb '#808080' lt 0 lw 1
set grid back ls 12
plot 'imp' u 1:3 ls 1 w lp
這給了我幾乎所需的輸出。
問題是,線路回來了,因爲時間從晚上23點到09點。我在想,也許我應該有時間和日期。或者有另一種方法來解決這個問題?感謝很多您的時間
對於相同的問題,請參閱[python gnuplot讀取csv文件以讀取順序或行順序繪製x軸的時間](http://stackoverflow.com/q/25308739/2604213)。我正在投票重複。我的建議是,雖然,如果你可以控制你的數據輸出,寫入時間戳:) – Christoph 2014-09-05 06:54:17