From 13479e1862472cb45f84a984c02de0eecfd83be5 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Wed, 12 Oct 2011 00:29:07 -0300 Subject: [PATCH] m1rc3/norruption/2/plot-cdf: added option -i to interpolate empirical results --- m1rc3/norruption/2/plot-cdf | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/m1rc3/norruption/2/plot-cdf b/m1rc3/norruption/2/plot-cdf index 832b9cb..8e2f394 100755 --- a/m1rc3/norruption/2/plot-cdf +++ b/m1rc3/norruption/2/plot-cdf @@ -1,4 +1,19 @@ #!/usr/bin/perl + +sub usage +{ + print STDERR "usage: $0 [-i] [log_file]\n"; + exit(1); +} + + +$with = "steps"; +if ($ARGV[0] eq "-i") { + shift @ARGV; + $with = "lines"; +} +&usage if $ARGV[0] =~ /^-/; + $n = 1; while (<>) { next unless /^=== (\d+) ===/; @@ -25,7 +40,7 @@ $cmd = "|gnuplot -e '". 'set xlabel "Power cycles";'. 'set ylabel "Cumulative probability";'. 'set key bottom;'. - 'plot "-" with steps title "Empirical distribution (N='.@f.')", '. + 'plot "-" with '.$with.' title "Empirical distribution (N='.@f.')", '. '1-exp(-'.1/$f.'*x) with lines lt 3 '. 'title "Exponential distribution ({/Symbol l}=1/'.$f.')"'. "'";