@@ -1158,28 +1158,21 @@ def _get_anchored_bbox(self, loc, bbox, parentbbox, renderer):
1158
1158
loc , bbox , parentbbox ,
1159
1159
self .borderaxespad * renderer .points_to_pixels (self ._fontsize ))
1160
1160
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."""
1168
1163
assert self .isaxes # always holds, as this is only called internally
1169
1164
1170
1165
start_time = time .perf_counter ()
1171
1166
1172
1167
bboxes , lines , offsets = self ._auto_legend_data ()
1173
1168
1174
1169
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 ))]
1180
1170
1181
1171
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 )
1183
1176
legendBox = Bbox .from_bounds (l , b , width , height )
1184
1177
badness = 0
1185
1178
# XXX TODO: If markers are present, it would be good to take them
0 commit comments