'Return the format for tick value `x`.
The position `pos` is ignored.'

def __call__(self, x, pos=None):

    usetex = rcParams[u'text.usetex']
    min_exp = rcParams[u'axes.formatter.min_exponent']
    if (x == 0):
        if usetex:
            return u'$0$'
        else:
            return (u'$%s$' % _mathdefault(u'0'))
    sign_string = (u'-' if (x < 0) else u'')
    x = abs(x)
    b = self._base
    fx = (math.log(x) / math.log(b))
    is_x_decade = is_close_to_int(fx)
    exponent = (np.round(fx) if is_x_decade else np.floor(fx))
    coeff = np.round((x / (b ** exponent)))
    if is_x_decade:
        fx = nearest_long(fx)
    if (self.labelOnlyBase and (not is_x_decade)):
        return u''
    if ((self._sublabels is not None) and (coeff not in self._sublabels)):
        return u''
    if ((b % 1) == 0.0):
        base = (u'%d' % b)
    else:
        base = (u'%s' % b)
    if (np.abs(fx) < min_exp):
        if usetex:
            return u'${0}{1:g}$'.format(sign_string, x)
        else:
            return u'${0}$'.format(_mathdefault(u'{0}{1:g}'.format(sign_string, x)))
    elif (not is_x_decade):
        return self._non_decade_format(sign_string, base, fx, usetex)
    elif usetex:
        return (u'$%s%s^{%d}$' % (sign_string, base, nearest_long(fx)))
    else:
        return (u'$%s$' % _mathdefault((u'%s%s^{%d}' % (sign_string, base, nearest_long(fx)))))
