# to see contents of create_data function, look at the top-most algorithm's code
figure, axes, handles = create_plots(data, baselines)
for i, (ax, y) in enumerate(zip(axes, data)):
    if i == 1:
        lam = 1e4
    elif i == 3:
        lam = 5e2
    else:
        lam = 1e3
    if i == 4:
        # few baseline points are identified, so use a higher p value so
        # that other points contribute to fitting, same as mpls; done so
        # that no errors occur in case no baseline points are identified
        p = 0.1
    else:
        p = 0
    baseline, params = baseline_fitter.mpspline(
        y, lam=lam, p=p, pad_kwargs={'extrapolate_window': 30}
    )
    ax.plot(baseline, 'g--')