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 09069b1

Browse filesBrowse files
authored
Merge pull request #27535 from rcomer/legend-argtypes
Update ax.legend input types
2 parents 1e809b3 + a058010 commit 09069b1
Copy full SHA for 09069b1

File tree

Expand file treeCollapse file tree

2 files changed

+5
-5
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+5
-5
lines changed

‎lib/matplotlib/axes/_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_axes.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ def legend(self, *args, **kwargs):
280280
281281
Parameters
282282
----------
283-
handles : sequence of (`.Artist` or tuple of `.Artist`), optional
283+
handles : list of (`.Artist` or tuple of `.Artist`), optional
284284
A list of Artists (lines, patches) to be added to the legend.
285285
Use this together with *labels*, if you need full control on what
286286
is shown in the legend and the automatic mechanism described above

‎lib/matplotlib/axes/_axes.pyi

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_axes.pyi
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import matplotlib.streamplot as mstream
3030

3131
import datetime
3232
import PIL.Image
33-
from collections.abc import Callable, Sequence
33+
from collections.abc import Callable, Iterable, Sequence
3434
from typing import Any, Literal, overload
3535
import numpy as np
3636
from numpy.typing import ArrayLike
@@ -56,11 +56,11 @@ class Axes(_AxesBase):
5656
@overload
5757
def legend(self) -> Legend: ...
5858
@overload
59-
def legend(self, handles: Sequence[Artist | tuple[Artist, ...]], labels: Sequence[str], **kwargs) -> Legend: ...
59+
def legend(self, handles: Iterable[Artist | tuple[Artist, ...]], labels: Iterable[str], **kwargs) -> Legend: ...
6060
@overload
61-
def legend(self, *, handles: Sequence[Artist | tuple[Artist, ...]], **kwargs) -> Legend: ...
61+
def legend(self, *, handles: Iterable[Artist | tuple[Artist, ...]], **kwargs) -> Legend: ...
6262
@overload
63-
def legend(self, labels: Sequence[str], **kwargs) -> Legend: ...
63+
def legend(self, labels: Iterable[str], **kwargs) -> Legend: ...
6464
@overload
6565
def legend(self, **kwargs) -> Legend: ...
6666

0 commit comments

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