1
0
mirror of git://projects.qi-hardware.com/ben-blinkenlights.git synced 2024-11-30 19:12:48 +02:00
ben-blinkenlights/ubb-patgen/table/mktab

41 lines
1020 B
Plaintext
Raw Normal View History

#!/usr/bin/perl
while (<>) {
chop;
push @a, $_;
}
#print "set term x11 size 500, 1000\n";
print "set term png lw 2 font \"Sans, 8\" size 500, 1000\n";
#print "set size 0.5, 1\n";
print "set logscale y\n";
print "set xrange [-0.5:4]\n";
print "set yrange [0.95:11]\n";
print "set ytics (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)\n";
print "unset xtics\n";
print "set title \"BEN NANONOTE MMC BUS CLOCK SPEEDS\"".
" font \"Helvetica, 10\"\n";
$x = 0;
for $b (10000, 100000, 1000000, 10000000) {
print "set arrow from $x, 1 to $x, 10 nohead lw 0\n";
if ($b >= 1e6) {
$si = "M";
$div = 1e6;
} elsif ($b >= 1e3) {
$si = "k";
$div = 1e3;
} else {
$si = "";
$div = 1;
}
print "set label \"${si}Hz\" at $x, 10.6 center\n";
print "set arrow from $x-0.2, 10.3 to $x+0.2, 10.3 nohead\n";
for (@a) {
next if $_ < $b || $_ >= $b*10;
$y = $_/$b;
print "set arrow from $x-0.1, $y to $x+0.1, $y nohead\n";
print "set label \"".sprintf("%g", $_/$div).
"\" at $x+0.2, $y\n";
}
$x++;
}
print "plot 0 notitle\n";