'Draw lines on the colorbar. It deletes preexisting lines.'

def add_lines(self, levels, colors, linewidths):

    del self.lines
    N = len(levels)
    x = np.array([1.0, 2.0])
    (X, Y) = np.meshgrid(x, levels)
    if (self.orientation == u'vertical'):
        xy = [list(zip(X[i], Y[i])) for i in xrange(N)]
    else:
        xy = [list(zip(Y[i], X[i])) for i in xrange(N)]
    col = collections.LineCollection(xy, linewidths=linewidths)
    self.lines = col
    col.set_color(colors)
    self.ax.add_collection(col)
