Skip to content

Commit

Permalink
colorbar: correct error introduced in commit 089024; closes #1102
Browse files Browse the repository at this point in the history
  • Loading branch information
efiring committed Aug 17, 2012
1 parent d0c501b commit 315573f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/matplotlib/colorbar.py
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 315573f

Please sign in to comment.