@@ -110,9 +110,33 @@ def _update_bbox_to_anchor(self, loc_in_canvas):
110
110
111
111
112
112
_legend_kw_doc = '''
113
- loc : int or string or pair of floats, default: :rc:`legend.loc` ('best' for \
114
- axes, 'upper right' for figures)
115
- The location of the legend. Possible codes are:
113
+ loc : str or pair of floats, default: :rc:`legend.loc` ('best' for axes, \
114
+ 'upper right' for figures)
115
+ The location of the legend.
116
+
117
+ The strings
118
+ ``'upper left', 'upper right', 'lower left', 'lower right'``
119
+ place the legend at the corresponding corner of the axes/figure.
120
+
121
+ The strings
122
+ ``'upper center', 'lower center', 'center left', 'center right'``
123
+ place the legend at the center of the corresponding edge of the
124
+ axes/figure.
125
+
126
+ The string ``'center'`` places the legend at the center of the axes/figure.
127
+
128
+ The string ``'best'`` places the legend at the location, among the nine
129
+ locations defined so far, with the minimum overlap with other drawn
130
+ artists. This option can be quite slow for plots with large amounts of
131
+ data; your plotting speed may benefit from providing a specific location.
132
+
133
+ The location can also be a 2-tuple giving the coordinates of the lower-left
134
+ corner of the legend in axes coordinates (in which case *bbox_to_anchor*
135
+ will be ignored).
136
+
137
+ For back-compatibility, ``'center right'`` (but no other location) can also
138
+ be spelled ``'right'``, and each "string" locations can also be given as a
139
+ numeric value:
116
140
117
141
=============== =============
118
142
Location String Location Code
@@ -130,15 +154,6 @@ def _update_bbox_to_anchor(self, loc_in_canvas):
130
154
'center' 10
131
155
=============== =============
132
156
133
-
134
- Alternatively can be a 2-tuple giving ``x, y`` of the lower-left
135
- corner of the legend in axes coordinates (in which case
136
- ``bbox_to_anchor`` will be ignored).
137
-
138
- The 'best' option can be quite slow for plots with large amounts
139
- of data. Your plotting speed may benefit from providing a specific
140
- location.
141
-
142
157
bbox_to_anchor : `.BboxBase`, 2-tuple, or 4-tuple of floats
143
158
Box that is used to position the legend in conjunction with *loc*.
144
159
Defaults to `axes.bbox` (if called as a method to `.Axes.legend`) or
0 commit comments