1
0
mirror of git://projects.qi-hardware.com/wernermisc.git synced 2024-12-24 06:14:36 +02:00

m1rc3/norruption/2/plot-cdf: added option -i to interpolate empirical results

This commit is contained in:
Werner Almesberger 2011-10-12 00:29:07 -03:00
parent a83a711733
commit 13479e1862

View File

@ -1,4 +1,19 @@
#!/usr/bin/perl #!/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; $n = 1;
while (<>) { while (<>) {
next unless /^=== (\d+) ===/; next unless /^=== (\d+) ===/;
@ -25,7 +40,7 @@ $cmd = "|gnuplot -e '".
'set xlabel "Power cycles";'. 'set xlabel "Power cycles";'.
'set ylabel "Cumulative probability";'. 'set ylabel "Cumulative probability";'.
'set key bottom;'. '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 '. '1-exp(-'.1/$f.'*x) with lines lt 3 '.
'title "Exponential distribution ({/Symbol l}=1/'.$f.')"'. 'title "Exponential distribution ({/Symbol l}=1/'.$f.')"'.
"'"; "'";