def center_bin(bins):
    """Shift a bin by half a step and remove the last item.

    This function can be used to prepare a suitable x axis for plotting.

    """
    return 0.5*(bins[1] - bins[0]) + bins[:-1]