def sort_xy(x, y):
    """Sort x/y data by the x values.

    Args:
        x (ndarray): x array
        y (ndarray): y array

    Returns:
        x/y data sorted by x

    """
    idx = x.argsort()
    return x[idx], y[idx]
