8000 MNT: Remove consider argument from Legend._find_best_position · matplotlib/matplotlib@6dfdc02 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6dfdc02

Browse files
committed
MNT: Remove consider argument from Legend._find_best_position
It is never passed in explicitly, and this is otherwise private.
1 parent 3ab6e1f commit 6dfdc02

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

lib/matplotlib/legend.py

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)
0