import numpy as np, matplotlib.pyplot as plt
X = np.random.randn(10000)
n = np.arange(1, len(X) + 1) / np.float(len(X))
Xs = np.sort(X)
plt.step(Xs, n)
Vertical line at the end of a CDF histogram using matplotlib