Mercurial > repos > erinija > plot_selected
diff plot_selected.sh @ 0:448204d12325 draft default tip
"planemo upload commit 1a32efb8343938e8d49190003f251c78b5a58225-dirty"
author | erinija |
---|---|
date | Fri, 01 May 2020 12:13:00 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plot_selected.sh Fri May 01 12:13:00 2020 +0000 @@ -0,0 +1,17 @@ +#!/bin/sh + +input=$1 +output=$2 +title=$3 +# columns should be separated by , : 1,2,4,5 +columns=$4 + +cut -f${columns} ${input} > input.tmp + +# calculate numberof columns +cnum=`head -n1 input.tmp | tr "\t" "\n" | wc | awk '{print $1}'` + +# plot the data with gnuplot in one line +gnuplot -e "set key outside; set terminal png; set output '${output}'; set title '${title}'; plot for [col=1:'${cnum}'] 'input.tmp' using 0:col with lines title columnheader;" + +rm input.tmp