Permalink
Browse files

colorbar: correct error introduced in commit 089024; closes #1102

  • Loading branch information...
1 parent d0c501b commit 315573fc9f2d26d2019bc146dbd577e43e6bf44e @efiring committed Aug 17, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 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)

0 comments on commit 315573f

Please sign in to comment.