nBins = 100
rng = [0, 1]
n, bins = np.histogram(data, nBins, rng)
x = bins[:-1] + 0.5 * np.diff(bins)
pp.figure(figsize=(7, 7), edgecolor='k', facecolor='w')
pp.step(x, n, where='mid', color='k', lw=2)
pp.show()
Python Matplotlib: plotting histogram with overlapping boundaries removed