def _get_y_min_max(y, plot_at_least):
    """
    Returns the maximum / minimum values which should be plotted according to
    plot_at_least.

    Parameters
    ----------
    y : list of floats
        The y values in question.

    plot_at_least : 2-tuple of floats
        The (from_below, from_above) percentage of points to show.

    Returns
    -------
    min_y_new : float
        The new minimum y value.
    max_y_new : float
        The new maximum y value.
    """
    sorted_y = sorted(y)
    max_y_new = sorted_y[min(len(sorted_y) - 1, int(plot_at_least[1] * len(
        sorted_y)))]
    min_y_new = sorted_y[int(plot_at_least[0] * (1 - len(sorted_y)))]
    return min_y_new, max_y_new
