def compute_y_at_middle_of_row(
    height_index_from_top: int, y_min: float, y_max: float, height: int
) -> float:
    """
    Returns the y level at the middle of the specified bin.

    Typical use case is to display the right axis tick.
    """
    step_size = (y_max - y_min) / height
    return (height - (height_index_from_top + 0.5)) * step_size + y_min