Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Merged
merged 1 commit into from

2 participants

@efiring
Owner

No description provided.

@mdboom mdboom merged commit 2a25fe8 into from
@efiring efiring deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/matplotlib/colorbar.py
View
6 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)
Something went wrong with that request. Please try again.