#!/bin/sh
cat > /tmp/tsl.gnuplot <<EOF
set key outside title 'Legend' box
set title "Macanbar Freezer Temperature ($1)"

set xlabel 'Hour of Day'
set xtics 0,1,24
set xrange [0:24]
set grid xtics

set ylabel 'Freezer'
set ytics nomirror -20,5,10
set mytics 5
set yrange [-20:10]
set grid ytics

set y2label 'Outdoor'
set y2tics 10,10,40
set y2range [10:40]

set data style lines

plot f(x) = (a), a = 0, f(x) title 'Zero', \
'$1' using 1:2 '%lf,%lf' title 'Truck', \
'$1' using 1:3 '%lf,%lf,%lf' title 'Big', \
'$1' using 1:4 '%lf,%lf,%lf,%lf' title 'Small', \
'$1' every 2 using 1:5 '%lf,%lf,%lf,%lf,%lf' smooth bezier axes x1y2 title 'Outside' 
EOF
gnuplot /tmp/tsl.gnuplot 2> /dev/null 1> /dev/null
