🌐 AI搜索 & 代理 主页
Skip to content

Commit b70e324

Browse files
timhoffmrcomer
andauthored
DOC: Improve docs of legend loc=best (#30854)
* DOC: Improve docs of legend loc=best Closes #29319. * Update lib/matplotlib/legend.py Co-authored-by: Ruth Comer <10599679+rcomer@users.noreply.github.com> --------- Co-authored-by: Ruth Comer <10599679+rcomer@users.noreply.github.com>
1 parent 9e210e8 commit b70e324

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/matplotlib/legend.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,13 @@ def _update_bbox_to_anchor(self, loc_in_canvas):
303303
_loc_doc_best = """
304304
The string ``'best'`` places the legend at the location, among the nine
305305
locations defined so far, with the minimum overlap with other drawn
306-
artists. This option can be quite slow for plots with large amounts of
307-
data; your plotting speed may benefit from providing a specific location.
306+
artists. This currently takes into account most, but not all, artists
307+
added to the Axes via plotting functions. In particular it does not consider
308+
inset axes, titles, or axis labels.
309+
310+
The computation of the best position can be expensive for plots with large
311+
amounts of data. If speed becomes a concern, you may may benefit from
312+
providing a specific location.
308313
"""
309314

310315
_legend_kw_axes_st = (

0 commit comments

Comments
 (0)