"""Original exact within/between-group variance example; PNG to cwd.""" from pathlib import Path import matplotlib.pyplot as plt def main(): fig, axes = plt.subplots(1, 2, figsize=(11, 4.8), layout="constrained") for y, values, mean, color in [(1, [0, 4], 2, "#315f86"), (0, [6, 10], 8, "#b5702b")]: axes[0].plot(values, [y, y], color=color, lw=2) axes[0].scatter(values, [y, y], color=color, s=70, zorder=3) axes[0].scatter([mean], [y], color=color, marker="x", s=90, linewidths=2, zorder=4) for value in values: axes[0].text((value+mean)/2, y+.12, "−2" if value