8000 Cleanup legend() docstring. · matplotlib/matplotlib@a8b6d4f · GitHub
[go: up one dir, main page]

Skip to content

Commit a8b6d4f

Browse files
committed
Cleanup legend() docstring.
I think "means using" reads better than "will take the value from", but am happy to hear other wordings proposals too.
1 parent 7c816c5 commit a8b6d4f

File tree

1 file changed

+35
-58
lines changed

1 file changed

+35
-58
lines changed

lib/matplotlib/legend.py

Lines changed: 35 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -171,22 +171,19 @@ def _update_bbox_to_anchor(self, loc_in_canvas):
171171
172172
fontsize : int or float or {'xx-small', 'x-small', 'small', 'medium', \
173173
'large', 'x-large', 'xx-large'}
174-
Controls the font size of the legend. If the value is numeric the
175-
size will be the absolute font size in points. String values are
176-
relative to the current default font size. This argument is only
177-
used if *prop* is not specified.
174+
The font size of the legend. If the value is numeric the size will be the
175+
absolute font size in points. String values are relative to the current
176+
default font size. This argument is only used if *prop* is not specified.
178177
179178
numpoints : None or int
180179
The number of marker points in the legend when creating a legend
181180
entry for a `.Line2D` (line).
182-
Default is ``None``, which will take the value from
183-
:rc:`legend.numpoints`.
181+
Default is ``None``, which means using :rc:`legend.numpoints`.
184182
185183
scatterpoints : None or int
186184
The number of marker points in the legend when creating
187185
a legend entry for a `.PathCollection` (scatter plot).
188-
Default is ``None``, which will take the value from
189-
:rc:`legend.scatterpoints`.
186+
Default is ``None``, which means using :rc:`legend.scatterpoints`.
190187
191188
scatteryoffsets : iterable of floats
192189
The vertical offset (relative to the font size) for the markers
@@ -197,8 +194,7 @@ def _update_bbox_to_anchor(self, loc_in_canvas):
197194
markerscale : None or int or float
198195
The relative size of legend markers compared with the originally
199196
drawn ones.
200-
Default is ``None``, which will take the value from
201-
:rc:`legend.markerscale`.
197+
Default is ``None``, which means using :rc:`legend.markerscale`.
202198
203199
markerfirst : bool
204200
If *True*, legend marker is placed to the left of the legend label.
@@ -207,40 +203,33 @@ def _update_bbox_to_anchor(self, loc_in_canvas):
207203
Default is *True*.
208204
209205
frameon : None or bool
210-
Control whether the legend should be drawn on a patch
211-
(frame).
212-
Default is ``None``, which will take the value from
213-
:rc:`legend.frameon`.
206+
Whether the legend should be drawn on a patch (frame).
207+
Default is ``None``, which means using :rc:`legend.frameon`.
214208
215209
fancybox : None or bool
216-
Control whether round edges should be enabled around the
217-
:class:`~matplotlib.patches.FancyBboxPatch` which makes up the
218-
legend's background.
219-
Default is ``None``, which will take the value from
220-
:rc:`legend.fancybox`.
210+
Whether round edges should be enabled around the `~.FancyBboxPatch` which
211+
makes up the legend's background.
212+
Default is ``None``, which means using :rc:`legend.fancybox`.
221213
222214
shadow : None or bool
223-
Control whether to draw a shadow behind the legend.
224-
Default is ``None``, which will take the value from
225-
:rc:`legend.shadow`.
215+
Whether to draw a shadow behind the legend.
216+
Default is ``None``, which means using :rc:`legend.shadow`.
226217
227218
framealpha : None or float
228-
Control the alpha transparency of the legend's background.
229-
Default is ``None``, which will take the value from
230-
:rc:`legend.framealpha`. If shadow is activated and
231-
*framealpha* is ``None``, the default value is ignored.
219+
The alpha transparency of the legend's background.
220+
Default is ``None``, which means using :rc:`legend.framealpha`.
221+
If *shadow* is activated and *framealpha* is ``None``, the default value is
222+
ignored.
232223
233224
facecolor : None or "inherit" or color
234-
Control the legend's background color.
235-
Default is ``None``, which will take the value from
236-
:rc:`legend.facecolor`. If ``"inherit"``, it will take
237-
:rc:`axes.facecolor`.
225+
The legend's background color.
226+
Default is ``None``, which means using :rc:`legend.facecolor`.
227+
If ``"inherit"``, use :rc:`axes.facecolor`.
238228
239229
edgecolor : None or "inherit" or color
240-
Control the legend's background patch edge color.
241-
Default is ``None``, which will take the value from
242-
:rc:`legend.edgecolor` If ``"inherit"``, it will take
243-
:rc:`axes.edgecolor`.
230+
The legend's background patch edge color.
231+
Default is ``None``, which means using :rc:`legend.edgecolor`.
232+
If ``"inherit"``, use take :rc:`axes.edgecolor`.
244233
245234
mode : {"expand", None}
246235
If *mode* is set to ``"expand"`` the legend will be horizontally
@@ -259,40 +248,28 @@ def _update_bbox_to_anchor(self, loc_in_canvas):
259248
The fontsize of the legend's title. Default is the default fontsize.
260249
261250
borderpad : float or None
262-
The fractional whitespace inside the legend border.
263-
Measured in font-size units.
264-
Default is ``None``, which will take the value from
265-
:rc:`legend.borderpad`.
251+
The fractional whitespace inside the legend border, in font-size units.
252+
Default is ``None``, which means using :rc:`legend.borderpad`.
266253
267254
labelspacing : float or None
268-
The vertical space between the legend entries.
269-
Measured in font-size units.
270-
Default is ``None``, which will take the value from
271-
:rc:`legend.labelspacing`.
255+
The vertical space between the legend entries, in font-size units.
256+
Default is ``None``, which means using :rc:`legend.labelspacing`.
272257
273258
handlelength : float or None
274-
The length of the legend handles.
275-
Measured in font-size units.
276-
Default is ``None``, which will take the value from
277-
:rc:`legend.handlelength`.
259+
The length of the legend handles, in font-size units.
260+
Default is ``None``, which means using :rc:`legend.handlelength`.
278261
279262
handletextpad : float or None
280-
The pad between the legend handle and text.
281-
Measured in font-size units.
282-
Default is ``None``, which will take the value from
283-
:rc:`legend.handletextpad`.
263+
The pad between the legend handle and text, in font-size units.
264+
Default is ``None``, which means using :rc:`legend.handletextpad`.
284265
285266
borderaxespad : float or None
286-
The pad between the axes and legend border.
287-
Measured in font-size units.
288-
Default is ``None``, which will take the value from
289-
:rc:`legend.borderaxespad`.
267+
The pad between the axes and legend border, in font-size units.
268+
Default is ``None``, which means using :rc:`legend.borderaxespad`.
290269
291270
columnspacing : float or None
292-
The spacing between columns.
293-
Measured in font-size units.
294-
Default is ``None``, which will take the value from
295-
:rc:`legend.columnspacing`.
271+
The spacing between columns, in font-size units.
272+
Default is ``None``, which means using :rc:`legend.columnspacing`.
296273
297274
handler_map : dict or None
298275
The custom dictionary mapping instances or types to a legend

0 commit comments

Comments
 (0)
0