locations = np.arange(0, 50, 1)
medians = locations / (1.0 + (locations / 5.0) ** 2)
disps = 0.1 + 0.5 * locations / (1.0 + (locations / 5.0) ** 2.0)
points = np.empty([50, 100])
for i in range(50):
    points[(i), :] = np.random.normal(loc=medians[i], scale=disps[i], size=100)
pcts = np.array([20, 35, 45, 55, 65, 80])
layers = np.empty([50, 6])
for i in range(50):
    _sorted = np.sort(points[(i), :])
layers[(i), :] = _sorted[pcts]
colors = ['blue', 'green', 'red', 'green', 'blue']
for i in range(5):
    plt.fill_between(locations, layers[:, (i)], layers[:, (i + 1)], color=
        colors[i])
plt.show()
Plotting stochastic processes in Python