Skip to content

Commit

Permalink
Allow us to specify x-axis data as time/date datatype in mkgraph.sh.
Browse files Browse the repository at this point in the history
  • Loading branch information
MasaoFujii committed Oct 12, 2016
1 parent 3b296f7 commit de43768
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mkgraph.sh
Expand Up @@ -9,6 +9,8 @@ PLOTSTR=
XLABEL=
YLABEL=
SEPARATOR=
XTIMESET=
XTIMEFMT=

usage ()
{
Expand Down Expand Up @@ -36,6 +38,7 @@ Options:
-t TITLE shows graph title
--xlabel LABEL shows label for x-axis
--ylabel LABEL shows label for y-axis
--xtime FMT reads x-axis data as time/date datatype in FMT format
EOF
}

Expand All @@ -59,6 +62,10 @@ while [ $# -gt 0 ]; do
--ylabel)
YLABEL="$2"
shift;;
--xtime)
XTIMESET="set xdata time"
XTIMEFMT="set timefmt \"$2\""
shift;;
*)
if [ -z "$INPUT" ]; then
INPUT="$1"
Expand Down Expand Up @@ -107,6 +114,8 @@ done
gnuplot <<EOF
set terminal png
$SEPARATOR
$XTIMESET
$XTIMEFMT
set output "$OUTPUT"
set title "$TITLE"
set border 3
Expand Down

0 comments on commit de43768

Please sign in to comment.