from pathlib import Path import matplotlib.pyplot as plt ad_spend = [120, 180, 240, 310, 380, 440, 520, 600] sales = [980, 1250, 1420, 1680, 1890, 2100, 2380, 2650] conversion_rate = [2.1, 2.4, 2.8, 3.0, 3.2, 3.4, 3.7, 3.9] orders = [24, 31, 35, 42, 48, 54, 61, 68] if len({len(ad_spend), len(sales), len(conversion_rate), len(orders)}) != 1: raise ValueError("Each data series must contain one value per point") marker_size = [order * 6 for order in orders] output = Path("campaign-scatter-plot.png")