Skip to content

Commit a92824c

Browse files
ksundenmeeseeksmachine
authored andcommitted
Backport PR #28474: Fix typing and docs for containers
1 parent 826575f commit a92824c

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

lib/matplotlib/axes/_axes.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -3527,11 +3527,11 @@ def errorbar(self, x, y, yerr=None, xerr=None,
35273527
`.ErrorbarContainer`
35283528
The container contains:
35293529
3530-
- plotline: `~matplotlib.lines.Line2D` instance of x, y plot markers
3530+
- data_line : A `~matplotlib.lines.Line2D` instance of x, y plot markers
35313531
and/or line.
3532-
- caplines: A tuple of `~matplotlib.lines.Line2D` instances of the error
3532+
- caplines : A tuple of `~matplotlib.lines.Line2D` instances of the error
35333533
bar caps.
3534-
- barlinecols: A tuple of `.LineCollection` with the horizontal and
3534+
- barlinecols : A tuple of `.LineCollection` with the horizontal and
35353535
vertical error ranges.
35363536
35373537
Other Parameters

lib/matplotlib/container.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@ class ErrorbarContainer(Container):
8787
lines : tuple
8888
Tuple of ``(data_line, caplines, barlinecols)``.
8989
90-
- data_line : :class:`~matplotlib.lines.Line2D` instance of
91-
x, y plot markers and/or line.
92-
- caplines : tuple of :class:`~matplotlib.lines.Line2D` instances of
93-
the error bar caps.
94-
- barlinecols : list of :class:`~matplotlib.collections.LineCollection`
95-
with the horizontal and vertical error ranges.
90+
- data_line : A `~matplotlib.lines.Line2D` instance of x, y plot markers
91+
and/or line.
92+
- caplines : A tuple of `~matplotlib.lines.Line2D` instances of the error
93+
bar caps.
94+
- barlinecols : A tuple of `~matplotlib.collections.LineCollection` with the
95+
horizontal and vertical error ranges.
9696
9797
has_xerr, has_yerr : bool
9898
``True`` if the errorbar has x/y errors.
@@ -115,13 +115,13 @@ class StemContainer(Container):
115115
116116
Attributes
117117
----------
118-
markerline : :class:`~matplotlib.lines.Line2D`
118+
markerline : `~matplotlib.lines.Line2D`
119119
The artist of the markers at the stem heads.
120120
121-
stemlines : list of :class:`~matplotlib.lines.Line2D`
121+
stemlines : `~matplotlib.collections.LineCollection`
122122
The artists of the vertical lines for all stems.
123123
124-
baseline : :class:`~matplotlib.lines.Line2D`
124+
baseline : `~matplotlib.lines.Line2D`
125125
The artist of the horizontal baseline.
126126
"""
127127
def __init__(self, markerline_stemlines_baseline, **kwargs):
@@ -130,7 +130,7 @@ def __init__(self, markerline_stemlines_baseline, **kwargs):
130130
----------
131131
markerline_stemlines_baseline : tuple
132132
Tuple of ``(markerline, stemlines, baseline)``.
133-
``markerline`` contains the `.LineCollection` of the markers,
133+
``markerline`` contains the `.Line2D` of the markers,
134134
``stemlines`` is a `.LineCollection` of the main lines,
135135
``baseline`` is the `.Line2D` of the baseline.
136136
"""

lib/matplotlib/container.pyi

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ class BarContainer(Container):
3434
) -> None: ...
3535

3636
class ErrorbarContainer(Container):
37-
lines: tuple[Line2D, Line2D, LineCollection]
37+
lines: tuple[Line2D, tuple[Line2D, ...], tuple[LineCollection, ...]]
3838
has_xerr: bool
3939
has_yerr: bool
4040
def __init__(
4141
self,
42-
lines: tuple[Line2D, Line2D, LineCollection],
42+
lines: tuple[Line2D, tuple[Line2D, ...], tuple[LineCollection, ...]],
4343
has_xerr: bool = ...,
4444
has_yerr: bool = ...,
4545
**kwargs

0 commit comments

Comments
 (0)