Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit dd08ab0

Browse filesBrowse files
authored
Merge pull request #20333 from anntzer/legend-init
Better align param comments in `Legend.__init__` signature.
2 parents 08f4629 + cd83494 commit dd08ab0
Copy full SHA for dd08ab0

File tree

Expand file treeCollapse file tree

1 file changed

+38
-44
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+38
-44
lines changed

‎lib/matplotlib/legend.py

Copy file name to clipboardExpand all lines: lib/matplotlib/legend.py
+38-44Lines changed: 38 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -301,50 +301,44 @@ def __str__(self):
301301
return "Legend"
302302

303303
@docstring.dedent_interpd
304-
def __init__(self, parent, handles, labels,
305-
loc=None,
306-
numpoints=None, # the number of points in the legend line
307-
markerscale=None, # the relative size of legend markers
308-
# vs. original
309-
markerfirst=True, # controls ordering (left-to-right) of
310-
# legend marker and label
311-
scatterpoints=None, # number of scatter points
312-
scatteryoffsets=None,
313-
prop=None, # properties for the legend texts
314-
fontsize=None, # keyword to set font size directly
315-
labelcolor=None, # keyword to set the text color
316-
317-
# spacing & pad defined as a fraction of the font-size
318-
borderpad=None, # the whitespace inside the legend border
319-
labelspacing=None, # the vertical space between the legend
320-
# entries
321-
handlelength=None, # the length of the legend handles
322-
handleheight=None, # the height of the legend handles
323-
handletextpad=None, # the pad between the legend handle
324-
# and text
325-
borderaxespad=None, # the pad between the axes and legend
326-
# border
327-
columnspacing=None, # spacing between columns
328-
329-
ncol=1, # number of columns
330-
mode=None, # mode for horizontal distribution of columns.
331-
# None, "expand"
332-
333-
fancybox=None, # True use a fancy box, false use a rounded
334-
# box, none use rc
335-
shadow=None,
336-
title=None, # set a title for the legend
337-
title_fontsize=None, # the font size for the title
338-
framealpha=None, # set frame alpha
339-
edgecolor=None, # frame patch edgecolor
340-
facecolor=None, # frame patch facecolor
341-
342-
bbox_to_anchor=None, # bbox that the legend will be anchored.
343-
bbox_transform=None, # transform for the bbox
344-
frameon=None, # draw frame
345-
handler_map=None,
346-
title_fontproperties=None, # properties for the legend title
347-
):
304+
def __init__(
305+
self, parent, handles, labels,
306+
loc=None,
307+
numpoints=None, # number of points in the legend line
308+
markerscale=None, # relative size of legend markers vs. original
309+
markerfirst=True, # left/right ordering of legend marker and label
310+
scatterpoints=None, # number of scatter points
311+
scatteryoffsets=None,
312+
prop=None, # properties for the legend texts
313+
fontsize=None, # keyword to set font size directly
314+
labelcolor=None, # keyword to set the text color
315+
316+
# spacing & pad defined as a fraction of the font-size
317+
borderpad=None, # whitespace inside the legend border
318+
labelspacing=None, # vertical space between the legend entries
319+
handlelength=None, # length of the legend handles
320+
handleheight=None, # height of the legend handles
321+
handletextpad=None, # pad between the legend handle and text
322+
borderaxespad=None, # pad between the axes and legend border
323+
columnspacing=None, # spacing between columns
324+
325+
ncol=1, # number of columns
326+
mode=None, # horizontal distribution of columns: None or "expand"
327+
328+
fancybox=None, # True: fancy box, False: rounded box, None: rcParam
329+
shadow=None,
330+
title=None, # legend title
331+
title_fontsize=None, # legend title font size
332+
framealpha=None, # set frame alpha
333+
edgecolor=None, # frame patch edgecolor
334+
facecolor=None, # frame patch facecolor
335+
336+
bbox_to_anchor=None, # bbox to which the legend will be anchored
337+
bbox_transform=None, # transform for the bbox
338+
frameon=None, # draw frame
339+
handler_map=None,
340+
title_fontproperties=None, # properties for the legend title
341+
):
348342
"""
349343
Parameters
350344
----------

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.