Skip to content

Instantly share code, notes, and snippets.

@drio
Created May 5, 2010 15:22
Show Gist options
  • Save drio/390916 to your computer and use it in GitHub Desktop.
Save drio/390916 to your computer and use it in GitHub Desktop.
gplot gnuplot errorrate erate
#!/bin/bash
sample="test"
data_f="/tmp/data.txt"
gp_cfg_f="/tmp/gplot.${sample}.cfg"
input_file=$1
#1 220 5220
#2 252 5215
cat $input_file | head -27 | tail -25 |\
awk '{print $1"\t"$4"\t"$5}' > $data_f
(
cat <<-EOF
set terminal png nocrop size 750,450
set nokey
set xtics 2
set grid x y
#set datafile separator ","
set t png
#set xrange [0:800]
#set yrange [0:100]
set output "output.png"
set xlabel "cycle"
set ylabel "mismatch rate"
set title "$sample"
plot "$data_f" using 1:((\$2*100)/\$3)
EOF
) > $gp_cfg_f
cat $gp_cfg_f | gnuplot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment