Code: Graph of Binaries
 ``` \$pair[1]) { \$a = \$pair[0]; \$b = \$pair[1]; } else { \$a = \$pair[1]; \$b = \$pair[0]; } if ((\$a == 0) or (\$b == 0)) { \$errors[] = '['.\$str.']'; } else \$result[] = strval(round((\$a / \$b) * 100)); } else \$errors[] = '['.\$str.']'; } } } \$tmp = array_count_values(\$result); ksort(\$tmp); include_once('Geometry.php'); \$pts[] = Pt('primary / secondary magnitude', 'number of binary systems (thousands)'); \$within = \$without = 0; // how many are within 10% foreach(\$tmp as \$ratio => \$count) { if (\$count > 99) { if (\$ratio > 99) { \$pts[] = Pt(\$ratio / 100, \$count); if (\$ratio > 110) { \$without += \$count; } else { \$within += \$count; } } else \$errors[] = '['.\$ratio.' '.\$count.']'; } } \$pts[] = Pt(2, 100); \$pts[] = Pt(2, 0); foreach(\$errors as \$oneError) AlertBox(1, \$oneError); \$result = ''; foreach(\$pts as \$pt) { if (is_numeric(\$pt['y'])) \$pt['y'] = \$pt['y'] / 1000; \$result .= \$pt['x'].kTAB.\$pt['y'].kLF; } file_put_contents(\$folder.'results.txt', \$result);   ?>```