#!/bin/bash

if [  -n "$1" ]; then
   hist=$1
else
   hist="hist"
fi

gnuplot -p <<EOF
set terminal postscript landscape enhanced color
set output '$hist.ps'
set autoscale
set xlabel "time (secs)"
set title "Size of job list L vs time"
set ylabel "L"
plot '$hist' using 1:3
set title "Requests vs time"
set ylabel "cores"
plot '$hist' using 1:4
set title "Number of cores vs time"
set ylabel "cores"
plot '$hist' using 1:2
EOF

ps2pdf $hist.ps
rm -f $hist.ps
