Commit 40d92b70 authored by Axel Auweter's avatar Axel Auweter
Browse files

Add variable PNG output resolution to dcdbplot.

parent 4bf1e1da
......@@ -9,6 +9,8 @@ LINES="lines"
SMOOTH=""
CLEANTEMP=1
LOCALTIME=0
XRES=1024
YRES=768
if [ "$#" -ge "1" ]; then
while [ "${1:0:1}" == "-" ]; do
......@@ -34,24 +36,29 @@ fi
if [ -t 0 ]; then
if [ "$#" -lt "1" ]; then
echo "Usage: dcdbplot [options] [infile] [outfile]"
echo "Usage: dcdbplot [options] [infile] [outfile] [[xRes] [yRes]]"
echo ""
echo "Parameters:"
echo " infile CSV input data, may be piped to stdin"
echo " outfile optional PNG output file (X11 is default output)"
echo " infile CSV input data, may be piped from stdin"
echo " outfile optional PNG output file (X11 is default output)"
echo " xRes, yRes resolution when writing to file (default: 1024x786)"
echo ""
echo " -p Mark points in graph"
echo " -b Smooth graph with Bezier curves"
echo " -c Smooth graph with csplines"
echo " -z Start y-axis at 0"
echo " -t Don't clean temporary files"
echo " -l Print timestamps as local time"
echo " -p Mark points in graph"
echo " -b Smooth graph with Bezier curves"
echo " -c Smooth graph with csplines"
echo " -z Start y-axis at 0"
echo " -t Don't clean temporary files"
echo " -l Print timestamps as local time"
exit
fi
INFILE=$1
if [ "$#" -gt "1" ]; then
OUTFILE=$2
fi
if [ "$#" -gt "3" ]; then
XRES=$3
YRES=$4
fi
else
INFILETMP=1
INFILE=$(mktemp)
......@@ -61,6 +68,10 @@ else
if [ "$#" -gt "0" ]; then
OUTFILE=$1
fi
if [ "$#" -gt "2" ]; then
XRES=$2
YRES=$3
fi
fi
echo "Outfile: $OUTFILE"
......@@ -136,7 +147,7 @@ EOF
if [ ! -z "$OUTFILE" ]; then
cat >> $TMP/plot.gplt << EOF
set terminal png size 1024,768
set terminal png size $XRES,$YRES
set output '$OUTFILE'
EOF
fi
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment