def _get_bunch_bounds(bunch):
    """Return the data bounds of a bunch."""
    if 'data_bounds' in bunch and bunch.data_bounds is not None:
        return bunch.data_bounds
    xmin, ymin = bunch.pos.min(axis=0)
    xmax, ymax = bunch.pos.max(axis=0)
    return (xmin, ymin, xmax, ymax)