0
私は、機器のパワーに関する履歴情報を読み、そのポイントでカーブをプリントするスクリプトを開発しています。私はdatetimeを表示するためにx軸を設定しました。私はそれをそのようにした:Gnuplotはx軸に年を表示しません
# source and filename are both variable names.
set xdata time
set terminal pngcairo enhanced font "arial,10" fontscale 1.0 size 900, 350
set output filename
set key bmargin left horizontal Right noreverse enhanced autotitles box linetype -1 linewidth 1.000
# We set the datetime format
set timefmt '"%Y-%m-%d %H:%M:%S"'
set datafile missing 'None'
set style line 1 lt 2 lc rgb 'blue' lw 1
set style line 2 lt 2 lc rgb 'green' lw 1
set style line 3 lt 2 lc rgb 'red' lw 1
set style line 4 lt 2 lc rgb 'green' lw 1
plot source using 1:2 ls 1 with lines, source using 1:3 ls 2 with lines,source using 1:4 ls 3 with lines
これはうまくいくが、年を示さないx軸のラベル。なぜこうなった?私は正しく設定していない?最初に、各点の行を含む.dat
ファイルを生成します。私のpythonからGNUPLOTスクリプトを呼び出した後、できたファイルは、のようです:
.....................
"2016-08-22 04:00:00" 1812.44580078 2600.0 800
"2016-08-22 04:15:00" 1859.58398438 2600.0 800
"2016-08-22 04:30:00" 1785.85595703 2600.0 800
.....................
これはグラフがどのように見えるかです:
どのように私はそれを達成するだろうか?前もって感謝します。
ありがとう!!この形式は日付を正しく表します。 –