from matplotlib import pyplot as plt
stairs_iqr =[]
for reversals in range(10,41,5):
    threshs = []
    for _ in range(100):
        stairs = slab.Staircase(start_val=10, n_reversals=reversals)
        for trial in stairs:
            resp = stairs.simulate_response(3)
            stairs.add_response(resp)
        threshs.append(stairs.threshold())
    threshs.sort()
    stairs_iqr.append(threshs[74] - threshs[24]) # 75th-25th percentile
plt.plot(range(10,41,5), stairs_iqr)
plt.gca().set(xlabel='reversals', ylabel='threshold IQR')