def set_g_colorbar_label(colorbar, unit, scale, extra=''):
    """
    Function sets label of the colorbar for gravity acceleration surface function.
    """
    if unit == 'cgs':
        if scale == 'linear':
            colorbar.set_label(extra + ' $g/[cm s^{-2}]$')
        elif scale == 'log':
            colorbar.set_label(extra + ' log(g/[cgs])')
    elif unit == 'SI':
        if scale == 'linear':
            colorbar.set_label(extra + ' $g/[m s^{-2}]$')
        elif scale == 'log':
            colorbar.set_label(extra + ' log(g/[SI])')
