From 315573fc9f2d26d2019bc146dbd577e43e6bf44e Mon Sep 17 00:00:00 2001 From: Eric Firing Date: Fri, 17 Aug 2012 11:11:36 -1000 Subject: [PATCH] colorbar: correct error introduced in commit 089024; closes #1102 --- lib/matplotlib/colorbar.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/colorbar.py b/lib/matplotlib/colorbar.py index 149d536d742a..e476c5a539b3 100644 --- a/lib/matplotlib/colorbar.py +++ b/lib/matplotlib/colorbar.py @@ -212,7 +212,8 @@ class ColorbarBase(cm.ScalarMappable): the Axes instance in which the colorbar is drawn :attr:`lines` - a LineCollection if lines were drawn, otherwise None + a list of LineCollection if lines were drawn, otherwise + an empty list :attr:`dividers` a LineCollection if *drawedges* is True, otherwise None @@ -495,8 +496,9 @@ def add_lines(self, levels, colors, linewidths, erase=True): col = collections.LineCollection(xy, linewidths=linewidths) if erase and self.lines: - for lc in self.lines.pop(): + for lc in self.lines: lc.remove() + self.lines = [] self.lines.append(col) col.set_color(colors) self.ax.add_collection(col)