import numpy as np import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt from pathlib import Path hours = np.array([2., 3., 4., 5., 6.]) litres = np.array([14., 17., 23., 24., 32.]) target = Path("kiosk-scatter.png") if target.exists(): raise FileExistsError(target) fig, ax = plt.subplots(figsize=(9.6, 5.4), dpi=100) ax.scatter(hours, litres, color="#0078d4", s=65) ax.set(xlabel="Planned opening hours (hours)", ylabel="Dispensed amount (litres)", title="Synthetic refill kiosk days") ax.grid(alpha=0.2) fig.tight_layout() fig.savefig(target) plt.close(fig) print("Saved kiosk-scatter.png (960 x 540)")