'Return values describing the desired spacing and offset of ticks.
This method is called whenever the axis needs to be redrawn and is a
good method to override in subclasses that require control over tick locations.
The return value must be a list of tuples, one for each set of ticks::
(major tick spacing, offset),
(minor tick spacing, offset),
(sub-minor tick spacing, offset),'

def tickSpacing(self, minVal, maxVal, size):

    if (self._tickSpacing is not None):
        return self._tickSpacing
    dif = abs((maxVal - minVal))
    if (dif == 0):
        return []
    optimalTickCount = max(2.0, np.log(size))
    optimalSpacing = (dif / optimalTickCount)
    p10unit = (10 ** np.floor(np.log10(optimalSpacing)))
    intervals = (np.array([1.0, 2.0, 10.0, 20.0, 100.0]) * p10unit)
    minorIndex = 0
    while (intervals[(minorIndex + 1)] <= optimalSpacing):
        minorIndex += 1
    levels = [(intervals[(minorIndex + 2)], 0), (intervals[(minorIndex + 1)], 0)]
    if (self.style['maxTickLevel'] >= 2):
        minSpacing = min((size / 20.0), 30.0)
        maxTickCount = (size / minSpacing)
        if ((dif / intervals[minorIndex]) <= maxTickCount):
            levels.append((intervals[minorIndex], 0))
        return levels
