#!/bin/bash # plod - plot data using gnuplot : ${w:=640} ${h:=480} : ${pause:=sleep 1e9} : ${using:=1:2} : ${title:=} : ${style:=lines} if [ -n "$x0" -a -n "$x1" ]; then xrange="set xrange[$x0:$x1];" fi if [ -n "$y0" -a -n "$y1" ]; then yrange="set yrange[$y0:$y1];" fi if [ -n "$dx" ]; then xtics="set xtics $dx;" fi if [ -n "$dy" ]; then ytics="set ytics $dy;" fi if [ -z "$terminal" ]; then if [ -t 1 ]; then terminal="x11" gnuplot_opts="$gnuplot_opts -geometry ${w}x${h}" else terminal="png size $w,$h" pause= fi fi ( echo " set terminal $terminal; $xrange $yrange $xtics $ytics # bind Close 'exit gnuplot'; plot '-' using $using title '$title' with $style; " # | tee /dev/stderr cat echo 'e' $pause ) | gnuplot $gnuplot_opts