def ordered_predictions(xs, ys, preds, reverse=False):
    """
    Utility function that orders 2d points based on values associated to each point.

    Args:
        xs (Pandas series): Sequence of x coordinates (floats).
        ys (Pandas series): Sequence of y coordinates (floats).
        preds (Pandas series): Sequence of spatial prediction.
        reverse (bool): Optional. False will sort ascending, True will sort descending. Default is False.
        
    Returns:
        Returns the ordered xs, ys, preds.
    """
    assert len(xs) == len(ys) == len(preds)
    return list(
        zip(
            *[
                (x, y, z)
                for x, y, z in sorted(
                    zip(xs, ys, preds), key=lambda pair: pair[2], reverse=reverse
                )
            ]
        )
    )