def set_sym_y_labels(axis, mean=None):
    """
    Set symmetric y-limits for the specified axis.
    """
    low, upp = axis.get_ylim()
    if mean is None:
        mean = (upp - low) / 2
    if mean - low <= upp - mean:
        upp_ = upp
        low_ = mean - (upp - mean)
    else:
        upp_ = mean + (mean - low)
        low_ = low
    axis.set_ylim(low_, upp_)
