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 d5a2ff0

Browse filesBrowse files
authored
Merge pull request #26660 from meeseeksmachine/auto-backport-of-pr-26656-on-v3.8.x
Backport PR #26656 on branch v3.8.x (TYP: Fix some small bugs)
2 parents 023aa60 + e4f2ed4 commit d5a2ff0
Copy full SHA for d5a2ff0

File tree

Expand file treeCollapse file tree

6 files changed

+23
-18
lines changed
Filter options
Expand file treeCollapse file tree

6 files changed

+23
-18
lines changed

‎lib/matplotlib/_pylab_helpers.pyi

Copy file name to clipboardExpand all lines: lib/matplotlib/_pylab_helpers.pyi
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ from matplotlib.figure import Figure
66
class Gcf:
77
figs: OrderedDict[int, FigureManagerBase]
88
@classmethod
9-
def get_fig_manager(cls, num: int) -> FigureManagerBase: ...
9+
def get_fig_manager(cls, num: int) -> FigureManagerBase | None: ...
1010
@classmethod
1111
def destroy(cls, num: int | FigureManagerBase) -> None: ...
1212
@classmethod
@@ -20,7 +20,9 @@ class Gcf:
2020
@classmethod
2121
def get_num_fig_managers(cls) -> int: ...
2222
@classmethod
23-
def get_active(cls) -> FigureManagerBase: ...
23+
def get_active(cls) -> FigureManagerBase | None: ...
24+
@classmethod
25+
def _set_new_active_manager(cls, manager: FigureManagerBase) -> None: ...
2426
@classmethod
2527
def set_active(cls, manager: FigureManagerBase) -> None: ...
2628
@classmethod

‎lib/matplotlib/axes/_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_axes.py
+5-2Lines changed: 5 additions & 2 deletions
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`, optional
283+
handles : sequence 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
@@ -289,6 +289,9 @@ def legend(self, *args, **kwargs):
289289
The length of handles and labels should be the same in this
290290
case. If they are not, they are truncated to the smaller length.
291291
292+
If an entry contains a tuple, then the legend handler for all Artists in the
293+
tuple will be placed alongside a single label.
294+
292295
labels : list of str, optional
293296
A list of labels to show next to the artists.
294297
Use this together with *handles*, if you need full control on what
@@ -3436,7 +3439,7 @@ def errorbar(self, x, y, yerr=None, xerr=None,
34363439
If True, will plot the errorbars above the plot
34373440
symbols. Default is below.
34383441
3439-
lolims, uplims, xlolims, xuplims : bool, default: False
3442+
lolims, uplims, xlolims, xuplims : bool or array-like, default: False
34403443
These arguments can be used to indicate that a value gives only
34413444
upper/lower limits. In that case a caret symbol is used to
34423445
indicate this. *lims*-arguments may be scalars, or array-likes of

‎lib/matplotlib/axes/_axes.pyi

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_axes.pyi
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ class Axes(_AxesBase):
5757
@overload
5858
def legend(self) -> Legend: ...
5959
@overload
60-
def legend(self, handles: Sequence[Artist], labels: Sequence[str], **kwargs) -> Legend: ...
60+
def legend(self, handles: Sequence[Artist | tuple[Artist, ...]], labels: Sequence[str], **kwargs) -> Legend: ...
6161
@overload
62-
def legend(self, *, handles: Sequence[Artist], **kwargs) -> Legend: ...
62+
def legend(self, *, handles: Sequence[Artist | tuple[Artist, ...]], **kwargs) -> Legend: ...
6363
@overload
6464
def legend(self, labels: Sequence[str], **kwargs) -> Legend: ...
6565
@overload
@@ -332,10 +332,10 @@ class Axes(_AxesBase):
332332
elinewidth: float | None = ...,
333333
capsize: float | None = ...,
334334
barsabove: bool = ...,
335-
lolims: bool = ...,
336-
uplims: bool = ...,
337-
xlolims: bool = ...,
338-
xuplims: bool = ...,
335+
lolims: bool | ArrayLike = ...,
336+
uplims: bool | ArrayLike = ...,
337+
xlolims: bool | ArrayLike = ...,
338+
xuplims: bool | ArrayLike = ...,
339339
errorevery: int | tuple[int, int] = ...,
340340
capthick: float | None = ...,
341341
*,

‎lib/matplotlib/legend.py

Copy file name to clipboardExpand all lines: lib/matplotlib/legend.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ def __init__(
401401
parent : `~matplotlib.axes.Axes` or `.Figure`
402402
The artist that contains the legend.
403403
404-
handles : list of `.Artist`
404+
handles : list of (`.Artist` or tuple of `.Artist`)
405405
A list of Artists (lines, patches) to be added to the legend.
406406
407407
labels : list of str
@@ -1330,7 +1330,7 @@ def _parse_legend_args(axs, *args, handles=None, labels=None, **kwargs):
13301330
13311331
Returns
13321332
-------
1333-
handles : list of `.Artist`
1333+
handles : list of (`.Artist` or tuple of `.Artist`)
13341334
The legend handles.
13351335
labels : list of str
13361336
The legend labels.

‎lib/matplotlib/legend.pyi

Copy file name to clipboardExpand all lines: lib/matplotlib/legend.pyi
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class Legend(Artist):
5252
def __init__(
5353
self,
5454
parent: Axes | Figure,
55-
handles: Iterable[Artist],
55+
handles: Iterable[Artist | tuple[Artist, ...]],
5656
labels: Iterable[str],
5757
*,
5858
loc: str | tuple[float, float] | int | None = ...,

‎lib/matplotlib/pyplot.py

Copy file name to clipboardExpand all lines: lib/matplotlib/pyplot.py
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,7 @@ def figure(
938938

939939
for hookspecs in rcParams["figure.hooks"]:
940940
module_name, dotted_name = hookspecs.split(":")
941-
obj = importlib.import_module(module_name)
941+
obj: Any = importlib.import_module(module_name)
942942
for part in dotted_name.split("."):
943943
obj = getattr(obj, part)
944944
obj(fig)
@@ -2961,10 +2961,10 @@ def errorbar(
29612961
elinewidth: float | None = None,
29622962
capsize: float | None = None,
29632963
barsabove: bool = False,
2964-
lolims: bool = False,
2965-
uplims: bool = False,
2966-
xlolims: bool = False,
2967-
xuplims: bool = False,
2964+
lolims: bool | ArrayLike = False,
2965+
uplims: bool | ArrayLike = False,
2966+
xlolims: bool | ArrayLike = False,
2967+
xuplims: bool | ArrayLike = False,
29682968
errorevery: int | tuple[int, int] = 1,
29692969
capthick: float | None = None,
29702970
*,

0 commit comments

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