@@ -194,7 +194,7 @@ def clabel(self, levels=None, *,
194
194
return self .labelTextsList
195
195
196
196
def print_label (self , linecontour , labelwidth ):
197
- """Return *False* if contours are too short for a label."""
197
+ """Return whether a contour is long enough to hold a label."""
198
198
return (len (linecontour ) > 10 * labelwidth
199
199
or (np .ptp (linecontour , axis = 0 ) > 1.2 * labelwidth ).any ())
200
200
@@ -514,13 +514,8 @@ def add_label_near(self, x, y, inline=True, inline_spacing=5,
514
514
# now lw in pixels
515
515
516
516
# Figure out label rotation.
517
- if inline :
518
- lcarg = lc
519
- else :
520
- lcarg = None
521
517
rotation , nlc = self .calc_label_rot_and_inline (
522
- slc , imin , lw , lcarg ,
523
- inline_spacing )
518
+ slc , imin , lw , lc if inline else None , inline_spacing )
524
519
525
520
self .add_label (xmin , ymin , rotation , self .labelLevelList [lmin ],
526
521
self .labelCValueList [lmin ])
@@ -574,13 +569,8 @@ def labels(self, inline, inline_spacing):
574
569
if self .print_label (slc , lw ):
575
570
x , y , ind = self .locate_label (slc , lw )
576
571
577
- if inline :
578
- lcarg = lc
579
- else :
580
- lcarg = None
581
572
rotation , new = self .calc_label_rot_and_inline (
582
- slc0 , ind , lw , lcarg ,
583
- inline_spacing )
573
+ slc0 , ind , lw , lc if inline else None , inline_spacing )
584
574
585
575
# Actually add the label
586
576
add_label (x , y , rotation , lev , cvalue )
0 commit comments