Permalink
Browse files

Fix bug in helper function which prevented the legend from avoiding v…

…ertices.

This bug was not triggered before because count_contains() was never
called due to the empty vertex list in Legend._find_best_position().
  • Loading branch information...
1 parent 96c0dca commit 9f17739c04e802f4294b76fa67aae993017324ab @maxalbert committed Jan 6, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/matplotlib/transforms.py
@@ -645,7 +645,7 @@ def count_contains(self, vertices):
dy0 = np.sign(vertices[:, 1] - y0)
dx1 = np.sign(vertices[:, 0] - x1)
dy1 = np.sign(vertices[:, 1] - y1)
- inside = (abs(dx0 + dx1) + abs(dy0 + dy1)) <= 2
+ inside = ((abs(dx0 + dx1) + abs(dy0 + dy1)) == 0)
return np.sum(inside)
def count_overlaps(self, bboxes):

0 comments on commit 9f17739

Please sign in to comment.