'Based on the colormap and extend variable, return the
number of boundaries.'

def _extended_N(self):

    N = (self.cmap.N + 1)
    if (self.extend == u'both'):
        N += 2
    elif (self.extend in (u'min', u'max')):
        N += 1
    return N
