我有一个看起来像这样的文件:情节从晚上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