'compute x axis limits and units'

def _compute_xmin_xmax(self):

    maxi = max([max(s.xvalues._get_cache()) for s in self._series])
    mul = None
    if (maxi < 1):
        s = str(maxi).split('.')[1]
        mul = 10
        for x in s:
            if (x == '0'):
                mul *= 10
            else:
                break
        maxi = (maxi * mul)
    maxi = math.ceil((maxi * 1.1))
    sz = (len(str(int(maxi))) - 1)
    unit = math.ceil((math.ceil((maxi / pow(10, sz))) * pow(10, (sz - 1))))
    maxi = (math.ceil((maxi / unit)) * unit)
    if (mul is not None):
        maxi = (maxi / mul)
        unit = (unit / mul)
    if ((maxi / unit) > 9):
        unit *= 2
    self.x_axis.max = maxi
    self.x_axis.unit = unit
