8000 DOC: Add numpydoc headings to legend. · matplotlib/matplotlib@4663936 · GitHub
[go: up one dir, main page]

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 4663936

Browse files
committed
DOC: Add numpydoc headings to legend.
1 parent a37b212 commit 4663936

File tree

1 file changed

+27
-15
lines changed

1 file changed

+27
-15
lines changed

lib/matplotlib/legend.py

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -941,13 +941,21 @@ def set_bbox_to_anchor(self, bbox, transform=None):
941941
"""
942942
Set the bbox that the legend will be anchored to.
943943
944-
*bbox* can be
945-
946-
- A `.BboxBase` instance
947-
- A tuple of ``(left, bottom, width, height)`` in the given transform
948-
(normalized axes coordinate if None)
949-
- A tuple of ``(left, bottom)`` where the width and height will be
950-
assumed to be zero.
944+
Parameters
945+
----------
946+
bbox : `~matplotlib.transforms.BboxBase` or tuple
947+
The bounding box can be specified in the following ways:
948+
949+
- A `.BboxBase` instance
950+
- A tuple of ``(left, bottom, width, height)`` in the given
951+
transform (normalized axes coordinate if None)
952+
- A tuple of ``(left, bottom)`` where the width and height will be
953+
assumed to be zero.
954+
- *None*, to remove the bbox anchoring, and use the parent bbox.
955+
956+
transform : `~matplotlib.transforms.Transform`, optional
957+
A transform to apply to the bounding box. If not specified, this
958+
will use a transform to the bounding box of the parent.
951959
"""
952960
if bbox is None:
953961
self._bbox_to_anchor = None
@@ -978,13 +986,16 @@ def _get_anchored_bbox(self, loc, bbox, parentbbox, renderer):
978986
Place the *bbox* inside the *parentbbox* according to a given
979987
location code. Return the (x, y) coordinate of the bbox.
980988
981-
- loc: a location code in range(1, 11).
982-
This corresponds to the possible values for self._loc, excluding
983-
"best".
989+
Parameters
990+
----------
991+
loc : int
992+
A location code in range(1, 11). This corresponds to the possible
993+
values for ``self._loc``, excluding "best".
994+
bbox : `~matplotlib.transforms.Bbox`
995+
bbox to be placed, in display coordinates.
996+
parentbbox : `~matplotlib.transforms.Bbox`
997+
A parent box which will contain the bbox, in display coordinates.
984998
985-
- bbox: bbox to be placed, display coordinate units.
986-
- parentbbox: a parent box which will contain the bbox. In
987-
display coordinates.
988999
"""
9891000
assert loc in range(1, 11) # called only internally
9901001

@@ -1079,8 +1090,9 @@ def set_draggable(self, state, use_blit=False, update='loc'):
10791090
10801091
Returns
10811092
-------
1082-
If *state* is ``True`` this returns the `~.DraggableLegend` helper
1083-
instance. Otherwise this returns ``None``.
1093+
`~.DraggableLegend` or *None*
1094+
If *state* is ``True`` this returns the `~.DraggableLegend` helper
1095+
instance. Otherwise this returns *None*.
10841096
"""
10851097
if state:
10861098
if self._draggable is None:

0 commit comments

Comments
 (0)
0