Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ef5d01a

Browse files
authored
Merge pull request #10710 from dopplershift/fix-error
BUG: Fix UnboundLocalError in contour labelling
2 parents 86a3c94 + ca9502e commit ef5d01a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/contour.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ def calc_label_rot_and_inline(self, slc, ind, lw, lc=None, spacing=5):
440440
# Actually break contours
441441
if closed:
442442
# This will remove contour if shorter than label
443-
if np.all(I != -1):
443+
if all(i != -1 for i in I):
444444
nlc.append(np.row_stack([xy2, lc[I[1]:I[0]+1], xy1]))
445445
else:
446446
# These will remove pieces of contour if they have length zero

0 commit comments

Comments
 (0)