def sci_format(x,lim):
    """
    Ticks formatter scientific notation with base 10. Adapted from https://www.py4u.net/discuss/140199
    """
    a, b = '{:.0e}'.format(x).split('e')
    b = int(b)
    return r'${} \times 10^{{{}}}$'.format(a, b)