@@ -1158,28 +1158,21 @@ def _get_anchored_bbox(self, loc, bbox, parentbbox, renderer):
11581158 loc , bbox , parentbbox ,
11591159 self .borderaxespad * renderer .points_to_pixels (self ._fontsize ))
11601160
1161- def _find_best_position (self , width , height , renderer , consider = None ):
1162- """
1163- Determine the best location to place the legend.
1164-
1165- *consider* is a list of ``(x, y)`` pairs to consider as a potential
1166- lower-left corner of the legend. All are display coords.
1167- """
1161+ def _find_best_position (self , width , height , renderer ):
1162+ """Determine the best location to place the legend."""
11681163 assert self .isaxes # always holds, as this is only called internally
11691164
11701165 start_time = time .perf_counter ()
11711166
11721167 bboxes , lines , offsets = self ._auto_legend_data ()
11731168
11741169 bbox = Bbox .from_bounds (0 , 0 , width , height )
1175- if consider is None :
1176- consider = [self ._get_anchored_bbox (x , bbox ,
1177- self .get_bbox_to_anchor (),
1178- renderer )
1179- for x in range (1 , len (self .codes ))]
11801170
11811171 candidates = []
1182- for idx , (l , b ) in enumerate (consider ):
1172+ for idx in range (1 , len (self .codes )):
1173+ l , b = self ._get_anchored_bbox (idx , bbox ,
1174+ self .get_bbox_to_anchor (),
1175+ renderer )
11831176 legendBox = Bbox .from_bounds (l , b , width , height )
11841177 badness = 0
11851178 # XXX TODO: If markers are present, it would be good to take them
0 commit comments