# graphcsv.gpi # # Usage: # $ GNUPLOT_INPUT=... absolute path to CSV ... # $ GNUPLOT_NUMCOLUMNS=`awk -F, 'NR == 1 { print NF; exit }' "${GNUPLOT_INPUT}"` # $ GNUPLOT_NUMROWS=$(((${GNUPLOT_NUMCOLUMNS} - 1) / 2)) # $ GNUPLOT_TMP=/tmp/gnuplots.gpi # $ echo "set multiplot layout ${GNUPLOT_NUMROWS},2 scale 1.0,0.8" > ${GNUPLOT_TMP} # $ for ((GI=2;GI<=${GNUPLOT_NUMCOLUMNS};GI++)) do printf "plot '${GNUPLOT_INPUT}' using 1:%d\n" $GI; done >> ${GNUPLOT_TMP} # $ echo "unset multiplot; pause -1" >> ${GNUPLOT_TMP} # $ gnuplot graphcsv.gpi ${GNUPLOT_TMP} # Output text-based graph #set terminal dumb set timefmt '%Y-%m-%d %H:%M:%S' #set xtics out rotate set xtics out set ytics out set xdata time set datafile sep ',' #set xrange["2015-01-01 00:00:00":"2015-12-31 23:59:59"] #set yrange [1000:] #set terminal png #set output "output.png" set grid set style data lines set format y '%.0f' #set format x "%m/%d %H:%M" set format x "%H:%M" # Change position of legend #set key left top # Disable legend #unset key set key autotitle columnhead