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