#! /bin/bash
# Last edited on 2017-06-12 01:46:03 by stolfilocal

dfile="$1"; shift

dname="${dfile%.*}"

pfile="${dname}.png"
rm -f "${pfile}"

export GDFONTPATH="${HOME}/ttf"

gnuplot <<EOF
  set term png medium size 1280,480 font "courbd,8"
  set output ".tmp.png"
  unset key
  unset xtics
  unset ytics
  set yrange [0:65540]
  plot "${dfile}" using 0:1 notitle with histeps lw 2.0
EOF

if [[ -r .tmp.png ]]; then
  convert .tmp.png -resize '50%' ${pfile} 
  if [[ ${show} ]]; then 
    display -title '%f' ${pfile} 
  fi
  rm -f .tmp.png
fi

