@@ -554,23 +554,14 @@ def labels(self, inline, inline_spacing):
554554 paths = con .get_paths ()
555555 for segNum , linepath in enumerate (paths ):
556556 lc = linepath .vertices # Line contour
557- slc0 = trans .transform (lc ) # Line contour in screen coords
558-
559- # For closed polygons, add extra point to avoid division by
560- # zero in print_label and locate_label. Other than these
561- # functions, this is not necessary and should probably be
562- # eventually removed.
563- if _is_closed_polygon (lc ):
564- slc = np .row_stack ([slc0 , slc0 [1 :2 ]])
565- else :
566- slc = slc0
557+ slc = trans .transform (lc ) # Line contour in screen coords
567558
568559 # Check if long enough for a label
569560 if self .print_label (slc , lw ):
570561 x , y , ind = self .locate_label (slc , lw )
571562
572563 rotation , new = self .calc_label_rot_and_inline (
573- slc0 , ind , lw , lc if inline else None , inline_spacing )
564+ slc , ind , lw , lc if inline else None , inline_spacing )
574565
575566 # Actually add the label
576567 add_label (x , y , rotation , lev , cvalue )
0 commit comments