def chartDistribution(distribution, outputfile=None):
    """
    Convenience function for displaying a matplotlib chart of an isotopic distribution
    generated by isotopicDistribution().
    """
    import matplotlib.pyplot as pyt
    from numpy import arange
    while distribution[-1] < 0.001:
        distribution = distribution[:-1]
    pyt.bar(list(range(0, len(distribution) + 1)), [0] + distribution,
        width=0.3, align='center')
    pyt.xticks(arange(1, len(distribution)))
    pyt.yticks(arange(0, 110, 10))
    pyt.ylim((0, 110))
    pyt.show()
    if outputfile:
        pyt.savefig(outputfile)
