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.')"'. "'";