def _calculate_x_bounds(params_data, padding):
    """Calculate the lower and upper ends of the x-axis for each group.

    Args:
        params_data (df): see _combine_params_data
        padding (float): the x_range is extended on each side by x_padding
            times the range of the data

    Returns:
        x_min (Series):
            The index are the parameter groups.
            The values are the left bound of the x-axis for this parameter group
        x_max (Series): Same as x_min but for right bound

    """
    raw_min = (
        params_data.groupby("group")[["conf_int_lower", "value"]].min().min(axis=1)
    )
    raw_max = (
        params_data.groupby("group")[["conf_int_upper", "value"]].max().max(axis=1)
    )
    white_space = (raw_max - raw_min).clip(1e-50) * padding
    x_min = raw_min - white_space
    x_max = raw_max + white_space
    x_min.name = "x_min"
    x_max.name = "x_max"
    return x_min, x_max