Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f25e02e

Browse files
authored
Merge pull request #10027 from dstansby/errbarcont-doc
Improve errorbar returns doc
2 parents 4165d7a + 6ac1319 commit f25e02e

File tree

2 files changed

+30
-8
lines changed

2 files changed

+30
-8
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2793,7 +2793,7 @@ def errorbar(self, x, y, yerr=None, xerr=None,
27932793
releases.
27942794
27952795
barsabove : bool, optional, default: False
2796-
if True , will plot the errorbars above the plot
2796+
If True , will plot the errorbars above the plot
27972797
symbols. Default is below.
27982798
27992799
lolims / uplims / xlolims / xuplims : bool, optional, default:None
@@ -2805,18 +2805,22 @@ def errorbar(self, x, y, yerr=None, xerr=None,
28052805
before :meth:`errorbar`.
28062806
28072807
errorevery : positive integer, optional, default:1
2808-
subsamples the errorbars. e.g., if errorevery=5, errorbars for
2808+
Subsamples the errorbars. e.g., if errorevery=5, errorbars for
28092809
every 5-th datapoint will be plotted. The data plot itself still
28102810
shows all data points.
28112811
28122812
Returns
28132813
-------
2814-
plotline : :class:`~matplotlib.lines.Line2D` instance
2815-
x, y plot markers and/or line
2816-
caplines : list of :class:`~matplotlib.lines.Line2D` instances
2817-
error bar cap
2818-
barlinecols : list of :class:`~matplotlib.collections.LineCollection`
2819-
horizontal and vertical error ranges.
2814+
:class:`~.container.ErrorbarContainer`
2815+
The container contains:
2816+
2817+
- plotline: :class:`~matplotlib.lines.Line2D` instance of
2818+
x, y plot markers and/or line.
2819+
- caplines: A tuple of :class:`~matplotlib.lines.Line2D` instances
2820+
of the error bar caps.
2821+
- barlinecols: A tuple of
2822+
:class:`~matplotlib.collections.LineCollection` with the
2823+
horizontal and vertical error ranges.
28202824
28212825
Other Parameters
28222826
----------------

lib/matplotlib/container.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,24 @@ def __init__(self, patches, errorbar=None, **kwargs):
114114

115115

116116
class ErrorbarContainer(Container):
117+
'''
118+
Container for errobars.
119+
120+
Attributes
121+
----------
122+
lines : tuple
123+
Tuple of ``(data_line, caplines, barlinecols)``.
124+
125+
- data_line : :class:`~matplotlib.lines.Line2D` instance of
126+
x, y plot markers and/or line.
127+
- caplines : tuple of :class:`~matplotlib.lines.Line2D` instances of
128+
the error bar caps.
129+
- barlinecols : list of :class:`~matplotlib.collections.LineCollection`
130+
with the horizontal and vertical error ranges.
131+
132+
has_xerr, has_yerr : bool
133+
``True`` if the errorbar has x/y errors.
134+
'''
117135

118136
def __init__(self, lines, has_xerr=False, has_yerr=False, **kwargs):
119137
self.lines = lines

0 commit comments

Comments
 (0)