標準入力から渡した値をプロットする
gnuplot -p -e "plot '< cat -' using 1:2 with lines"
from: https://stackoverflow.com/questions/4585770/gnuplot-stdin-how-to-plot-two-lines
y=sin(x)
seq -w 0 0.01 6.28 |
awk '{print $1, sin($1)}' |
gnuplot -p -e "plot '< cat -' using 1:2 with lines"
反比例 y=1/x
seq 1 100 |
awk '{print $1, 1/$1}' |
gnuplot -p -e "plot '< cat -' using 1:2 with lines"
日付のフォーマットを指定する
set xdata time
set timefmt '%Y%m%d%H%M%S'
参考: http://lowrank.net/gnuplot/datetime.html
線とか点とかのスタイルを指定する
凡例を非表示にする
unset key
PNGで出力する
set terminal pngcairo size 2560,1800
set output './plot.png'
下付き文字などを無効にする
terminalの設定にnoenhanced
をつけると下付き文字などを表示する拡張テキストモードが無効化される。
例:
set terminal svg size 640,480 font 'Verdana,10' noenhanced
点でなく線で描画する
with lines
をつけると線で描画してくれる。
plot 'data.txt' using 1:2 title 'data 1' with lines
xticsで時間軸を設定する