!./sonar/src/sonar
set size 1,1
set origin 0,0
set multiplot

set size 0.45,0.2
set origin 0,0.8
set xrange [0:250]
set autoscale y
set xlabel "sample"
set xtics 50
set ytics 20000
plot "/tmp/chirp.txt" using 1:2 with lines title 'chirp'

set size 0.45,0.2
set origin 0.5,0.8
set xrange [0:250]
set autoscale y
set xlabel "sample"
set ytics 5000
plot "/tmp/echo.txt" using 1:2 with lines title 'L echo', "" using 1:3 with lines title 'R echo'

set size 0.95,0.4
set origin 0,0.4
set xrange [2500:25000]
#set yrange [0:1e9]
set autoscale y
set xlabel "frequency"
set xtics 1000
set ytics 100000
set mxtics 2
plot "/tmp/spektra.txt" using 1:2 with lines title 'chirp spectrum'

set size 0.95,0.4
set origin 0,0.0
set xrange [2500:25000]
#set yrange [0:1e9]
set autoscale y
set ytics 25000
plot "/tmp/spektra.txt" using 1:3 with lines title 'Left echo spectrum', "" using 1:4 with lines title 'Right echo spectrum'
pause 2
reread