8000 Backport PR #10710: BUG: Fix UnboundLocalError in contour labelling · matplotlib/matplotlib@1749c2e · GitHub
[go: up one dir, main page]

Skip to content

Commit 1749c2e

Browse files
jklymakMeeseeksDev[bot]
authored andcommitted
Backport PR #10710: BUG: Fix UnboundLocalError in contour labelling
1 parent 9d7375f commit 1749c2e

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
@@ -441,7 +441,7 @@ def calc_label_rot_and_inline(self, slc, ind, lw, lc=None, spacing=5):
441441
# Actually break contours
442442
if closed:
443443
# This will remove contour if shorter than label
444-
if np.all(I != -1):
444+
if all(i != -1 for i in I):
445445
nlc.append(np.row_stack([xy2, lc[I[1]:I[0]+1], xy1]))
446446
else:
447447
# These will remove pieces of contour if they have length zero

0 commit comments

Comments
 (0)
0