8000 Merge pull request #27537 from meeseeksmachine/auto-backport-of-pr-27… · matplotlib/matplotlib@d5eaa2a · GitHub
[go: up one dir, main page]

Skip to content

Commit d5eaa2a

Browse files
authored
Merge pull request #27537 from meeseeksmachine/auto-backport-of-pr-27535-on-v3.8.x
Backport PR #27535 on branch v3.8.x (Update ax.legend input types)
2 parents 72a1224 + 428cf41 commit d5eaa2a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/matplotlib/axes/_axes.py

Lines 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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import matplotlib.streamplot as mstream
3131

3232
import datetime
3333 8000
import PIL.Image
34-
from collections.abc import Callable, Sequence
34+
from collections.abc import Callable, Iterable, Sequence
3535
from typing import Any, Literal, overload
3636
import numpy as np
3737
from numpy.typing import ArrayLike
@@ -57,11 +57,11 @@ class Axes(_AxesBase):
5757
@overload
5858
def legend(self) -> Legend: ...
5959
@overload
60-
def legend(self, handles: Sequence[Artist | tuple[Artist, ...]], labels: Sequence[str], **kwargs) -> Legend: ...
60+
def legend(self, handles: Iterable[Artist | tuple[Artist, ...]], labels: Iterable[str], **kwargs) -> Legend: ...
6161
@overload
62-
def legend(self, *, handles: Sequence[Artist | tuple[Artist, ...]], **kwargs) -> Legend: ...
62+
def legend(self, *, handles: Iterable[Artist | tuple[Artist, ...]], **kwargs) -> Legend: ...
6363
@overload
64-
def legend(self, labels: Sequence[str], **kwargs) -> Legend: ...
64+
def legend(self, labels: Iterable[str], **kwargs) -> Legend: ...
6565
@overload
6666
def legend(self, **kwargs) -> Legend: ...
6767

0 commit comments

Comments
 (0)
0