import pylab
counts = [0, 0, 0, 125, 56, 0, 0, 0, 34, 77, 123, 0, 0, 0]
artists = pylab.bar(align='center', *zip(*enumerate(counts)))
lefts = [item.get_x() for item in artists]
rights = [(item.get_x() + item.get_width()) for item in artists]
pylab.xlim([min(lefts), max(rights)])
pylab.show()
Force bins with zero-height in matplotlib bar plot