Wednesday, June 30, 2010

Gnuplot: 3D graph


set xlabel "Date"
set ylabel "Time"
set zlabel "Connections"

set xtics 86400
set ytics 14400, 14400, 86400

set xdata time
set ydata time

set format x "%m/%d/%y"
set format y "%H:%M"

set timefmt x "%m/%d/%y"
set timefmt y "%H:%M"

set dgrid3d 30,30

splot \
"blah" using 1:2:3 with pm3d, \
15 with lines lt 9

Gnuplot: more 2D graphs



set grid xtics front
set grid ytics front
set xdata time
set timefmt "%m/%d/%y-%H:%M"

set terminal png size 900,300 xffffff
set multiplot layout 2 , 1

### PLOT 1 ###
set size 1,0.3
set origin 0,0.7
set title ""
set key left box
set bmargin 0
set ytic 10,10,30
set yrange [0:40]
set ylabel "Attempts"
set format x ""
set xrange ["${TODAYS_DATE}-00:00" : "${TODAYS_DATE}-23:59"]
plot "${TMP_FILE}" using 1:5 title 'SYN_RECV' with boxes fs solid lt 9


### PLOT 2 ###
set size 1,0.7
set origin 0,0
set title ""
set key left box
set tmargin 0
set bmargin
set ytic 5,5,25
set yrange [0:30]
set ylabel "Connections"
set xlabel "Time"
set format x "%H:%M"
set xrange ["${TODAYS_DATE}-00:00" : "${TODAYS_DATE}-23:59"]
plot 15 title 'MaxClients = 15' lt 12, \
"${FILE}" using 1:4 title 'Queued' with boxes fs solid lt 1, \
"${FILE}" using 1:2 title 'Serviced' with boxes fs solid lt 2, \
"${FILE}" using 1:2 smooth bezier title 'Serviced (smooth)' lt 3

unset multiplot