Werner's Miscellanea
Sign in or create your account | Project List | Help
Werner's Miscellanea Commit Details
Date: | 2011-10-12 05:29:07 (12 years 5 months ago) |
---|---|
Author: | Werner Almesberger |
Commit: | 13479e1862472cb45f84a984c02de0eecfd83be5 |
Message: | m1rc3/norruption/2/plot-cdf: added option -i to interpolate
empirical results |
Files: |
m1rc3/norruption/2/plot-cdf (2 diffs) |
Change Details
m1rc3/norruption/2/plot-cdf | ||
---|---|---|
1 | 1 | #!/usr/bin/perl |
2 | ||
3 | sub usage | |
4 | { | |
5 | print STDERR "usage: $0 [-i] [log_file]\n"; | |
6 | exit(1); | |
7 | } | |
8 | ||
9 | ||
10 | $with = "steps"; | |
11 | if ($ARGV[0] eq "-i") { | |
12 | shift @ARGV; | |
13 | $with = "lines"; | |
14 | } | |
15 | &usage if $ARGV[0] =~ /^-/; | |
16 | ||
2 | 17 | $n = 1; |
3 | 18 | while (<>) { |
4 | 19 | next unless /^=== (\d+) ===/; |
... | ... | |
25 | 40 | 'set xlabel "Power cycles";'. |
26 | 41 | 'set ylabel "Cumulative probability";'. |
27 | 42 | 'set key bottom;'. |
28 | 'plot "-" with steps title "Empirical distribution (N='.@f.')", '. | |
43 | 'plot "-" with '.$with.' title "Empirical distribution (N='.@f.')", '. | |
29 | 44 | '1-exp(-'.1/$f.'*x) with lines lt 3 '. |
30 | 45 | 'title "Exponential distribution ({/Symbol l}=1/'.$f.')"'. |
31 | 46 | "'"; |
Branches:
master