mirror of
git://projects.qi-hardware.com/ben-blinkenlights.git
synced 2025-04-21 12:27:27 +03:00
ubb-patgen/table/: generate a PNG with a table of MMC bus clock frequencies
This commit is contained in:
40
ubb-patgen/table/mktab
Executable file
40
ubb-patgen/table/mktab
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/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\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";
|
||||
Reference in New Issue
Block a user