diff --git a/examples/more/00_example_template/example b/examples/more/00_example_template/example index c7304b6..3bd3578 100755 Binary files a/examples/more/00_example_template/example and b/examples/more/00_example_template/example differ diff --git a/examples/more/02_ci_beta/example b/examples/more/02_ci_beta/example index 7022d14..64f30ad 100755 Binary files a/examples/more/02_ci_beta/example and b/examples/more/02_ci_beta/example differ diff --git a/examples/more/03_ci_beta_parallel/example b/examples/more/03_ci_beta_parallel/example index 818b64f..8731335 100755 Binary files a/examples/more/03_ci_beta_parallel/example and b/examples/more/03_ci_beta_parallel/example differ diff --git a/examples/more/04_nuclear_war/example b/examples/more/04_nuclear_war/example index a1994d0..03cb857 100755 Binary files a/examples/more/04_nuclear_war/example and b/examples/more/04_nuclear_war/example differ diff --git a/examples/more/05_burn_10kg_fat/example b/examples/more/05_burn_10kg_fat/example index 4a7c6cb..da134e1 100755 Binary files a/examples/more/05_burn_10kg_fat/example and b/examples/more/05_burn_10kg_fat/example differ diff --git a/examples/more/06_nuclear_recovery/example b/examples/more/06_nuclear_recovery/example index ede6020..c5d18a1 100755 Binary files a/examples/more/06_nuclear_recovery/example and b/examples/more/06_nuclear_recovery/example differ diff --git a/examples/more/07_algebra/example b/examples/more/07_algebra/example index 826e264..f31f3d5 100755 Binary files a/examples/more/07_algebra/example and b/examples/more/07_algebra/example differ diff --git a/examples/more/08_algebra_and_conversion/example b/examples/more/08_algebra_and_conversion/example index dc0e757..3e9f28d 100755 Binary files a/examples/more/08_algebra_and_conversion/example and b/examples/more/08_algebra_and_conversion/example differ diff --git a/examples/more/09_ergonomic_algebra/example b/examples/more/09_ergonomic_algebra/example index 6109162..4b8ebd4 100755 Binary files a/examples/more/09_ergonomic_algebra/example and b/examples/more/09_ergonomic_algebra/example differ diff --git a/examples/more/10_twitter_thread_example/example b/examples/more/10_twitter_thread_example/example index 6db41c4..d44b5a5 100755 Binary files a/examples/more/10_twitter_thread_example/example and b/examples/more/10_twitter_thread_example/example differ diff --git a/examples/more/11_billion_lognormals_paralell/example b/examples/more/11_billion_lognormals_paralell/example index 6584d76..81790db 100755 Binary files a/examples/more/11_billion_lognormals_paralell/example and b/examples/more/11_billion_lognormals_paralell/example differ diff --git a/examples/more/12_time_to_botec_parallel/example b/examples/more/12_time_to_botec_parallel/example index 6faf293..abc2af2 100755 Binary files a/examples/more/12_time_to_botec_parallel/example and b/examples/more/12_time_to_botec_parallel/example differ diff --git a/examples/more/13_parallelize_min/example b/examples/more/13_parallelize_min/example index b63cdc0..5dbcc64 100755 Binary files a/examples/more/13_parallelize_min/example and b/examples/more/13_parallelize_min/example differ diff --git a/examples/more/14_check_confidence_interval/example b/examples/more/14_check_confidence_interval/example index 0d584dc..9f9b2af 100755 Binary files a/examples/more/14_check_confidence_interval/example and b/examples/more/14_check_confidence_interval/example differ diff --git a/squiggle_more.c b/squiggle_more.c index a3b34ab..0fc681d 100644 --- a/squiggle_more.c +++ b/squiggle_more.c @@ -364,7 +364,7 @@ void array_print_90_ci_histogram(double* xs, int n_samples, int n_bins) max_bin_count = bins[i]; } } - const int MAX_WIDTH = 50; // Adjust this to your terminal width + const int MAX_WIDTH = 40; // Adjust this to your terminal width double scale = max_bin_count > MAX_WIDTH ? (double)MAX_WIDTH / max_bin_count : 1.0; // Print the histogram @@ -374,7 +374,12 @@ void array_print_90_ci_histogram(double* xs, int n_samples, int n_bins) decimalPlaces = -magnitude; decimalPlaces = decimalPlaces > 10 ? 10 : decimalPlaces; } - printf("(-∞, %*.*f): %d\n", 4 + decimalPlaces, decimalPlaces, min_value, below_min); + printf("(%*s, %*.*f): ", 6 + decimalPlaces, "-∞", 4 + decimalPlaces, decimalPlaces, min_value); + int marks_below_min = (int)(below_min * scale); + for (int j = 0; j < marks_below_min; j++) { + printf("█"); + } + printf(" %d\n", below_min); for (int i = 0; i < n_bins; i++) { double bin_start = min_value + i * bin_width; double bin_end = bin_start + bin_width; @@ -392,7 +397,12 @@ void array_print_90_ci_histogram(double* xs, int n_samples, int n_bins) } printf(" %d\n", bins[i]); } - printf("(%*.*f, +∞): %d\n", 4 + decimalPlaces, decimalPlaces, max_value, above_max); + printf("(%*.*f, %*s): ", 4 + decimalPlaces, decimalPlaces, min_value, 6 + decimalPlaces, "+∞"); + int marks_above_max = (int)(above_max * scale); + for (int j = 0; j < marks_above_max; j++) { + printf("█"); + } + printf(" %d\n", above_max); // Free the allocated memory for bins free(bins);