@@ -2698,106 +2698,100 @@ def errorbar(self, x, y, yerr=None, xerr=None,
2698
2698
"""
2699
2699
Plot an errorbar graph.
2700
2700
2701
- Call signature::
2702
-
2703
- errorbar(x, y, yerr=None, xerr=None,
2704
- fmt='', ecolor=None, elinewidth=None, capsize=None,
2705
- barsabove=False, lolims=False, uplims=False,
2706
- xlolims=False, xuplims=False, errorevery=1,
2707
- capthick=None)
2708
-
2709
- Plot *x* versus *y* with error deltas in *yerr* and *xerr*.
2710
- Vertical errorbars are plotted if *yerr* is not *None*.
2711
- Horizontal errorbars are plotted if *xerr* is not *None*.
2701
+ Plot x versus y with error deltas in yerr and xerr.
2702
+ Vertical errorbars are plotted if yerr is not None.
2703
+ Horizontal errorbars are plotted if xerr is not None.
2712
2704
2713
- *x*, *y*, * xerr* , and * yerr* can all be scalars, which plots a
2714
- single error bar at *x*, *y* .
2705
+ x, y, xerr, and yerr can all be scalars, which plots a
2706
+ single error bar at x, y .
2715
2707
2716
- Optional keyword arguments:
2708
+ Parameters
2709
+ ----------
2710
+ x : scalar
2711
+ y : scalar
2717
2712
2718
- * xerr*/* yerr*: [ scalar | N, Nx1, or 2xN array-like ]
2713
+ xerr/ yerr : scalar or array-like, shape(n,1) or shape(2,n), optional
2719
2714
If a scalar number, len(N) array-like object, or an Nx1
2720
2715
array-like object, errorbars are drawn at +/-value relative
2721
- to the data.
2716
+ to the data. Default is None.
2722
2717
2723
2718
If a sequence of shape 2xN, errorbars are drawn at -row1
2724
2719
and +row2 relative to the data.
2725
2720
2726
- * fmt*: [ '' | 'none' | plot format string ]
2727
- The plot format symbol. If * fmt* is 'none' (case-insensitive),
2721
+ fmt : plot format string, optional, default: None
2722
+ The plot format symbol. If fmt is 'none' (case-insensitive),
2728
2723
only the errorbars are plotted. This is used for adding
2729
2724
errorbars to a bar plot, for example. Default is '',
2730
2725
an empty plot format string; properties are
2731
2726
then identical to the defaults for :meth:`plot`.
2732
2727
2733
- * ecolor*: [ *None* | mpl color ]
2728
+ ecolor : mpl color, optional, default: None
2734
2729
A matplotlib color arg which gives the color the errorbar lines;
2735
- if * None* , use the color of the line connecting the markers.
2730
+ if None, use the color of the line connecting the markers.
2736
2731
2737
- * elinewidth* : scalar
2738
- The linewidth of the errorbar lines. If * None* , use the linewidth.
2732
+ elinewidth : scalar, optional, default: None
2733
+ The linewidth of the errorbar lines. If None, use the linewidth.
2739
2734
2740
- * capsize* : scalar
2741
- The length of the error bar caps in points; if * None* , it will
2735
+ capsize : scalar, optional, default: None
2736
+ The length of the error bar caps in points; if None, it will
2742
2737
take the value from ``errorbar.capsize``
2743
2738
:data:`rcParam<matplotlib.rcParams>`.
2744
2739
2745
- * capthick* : scalar
2746
- An alias kwarg to * markeredgewidth* (a.k.a. - * mew* ). This
2740
+ capthick : scalar, optional, default: None
2741
+ An alias kwarg to markeredgewidth (a.k.a. - mew). This
2747
2742
setting is a more sensible name for the property that
2748
2743
controls the thickness of the error bar cap in points. For
2749
- backwards compatibility, if * mew* or * markeredgewidth* are given,
2750
- then they will over-ride * capthick*. This may change in future
2744
+ backwards compatibility, if mew or markeredgewidth are given,
2745
+ then they will over-ride capthick. This may change in future
2751
2746
releases.
2752
2747
2753
- * barsabove*: [ *True* | * False* ]
2754
- if * True* , will plot the errorbars above the plot
2748
+ barsabove : bool, optional, default: False
2749
+ if True , will plot the errorbars above the plot
2755
2750
symbols. Default is below.
2756
2751
2757
- * lolims* / * uplims* / * xlolims* / * xuplims*: [ *False* | *True* ]
2752
+ lolims / uplims / xlolims / xuplims : bool, optional, default:None
2758
2753
These arguments can be used to indicate that a value gives
2759
2754
only upper/lower limits. In that case a caret symbol is
2760
2755
used to indicate this. lims-arguments may be of the same
2761
2756
type as *xerr* and *yerr*. To use limits with inverted
2762
2757
axes, :meth:`set_xlim` or :meth:`set_ylim` must be called
2763
2758
before :meth:`errorbar`.
2764
2759
2765
- * errorevery* : positive integer
2760
+ errorevery : positive integer, optional, default:1
2766
2761
subsamples the errorbars. e.g., if errorevery=5, errorbars for
2767
2762
every 5-th datapoint will be plotted. The data plot itself still
2768
2763
shows all data points.
2769
2764
2770
- All other keyword arguments are passed on to the plot command for the
2771
- markers. For example, this code makes big red squares with
2772
- thick green edges::
2773
-
2774
- x,y,yerr = rand(3,10)
2775
- errorbar(x, y, yerr, marker='s',
2776
- mfc='red', mec='green', ms=20, mew=4)
2777
-
2778
- where *mfc*, *mec*, *ms* and *mew* are aliases for the longer
2779
- property names, *markerfacecolor*, *markeredgecolor*, *markersize*
2780
- and *markeredgewidth*.
2781
-
2782
- valid kwargs for the marker properties are
2765
+ Returns
2766
+ -------
2767
+ plotline : :class:`~matplotlib.lines.Line2D` instance
2768
+ x, y plot markers and/or line
2769
+ caplines : list of :class:`~matplotlib.lines.Line2D` instances
2770
+ error bar cap
2771
+ barlinecols : list of :class:`~matplotlib.collections.LineCollection`
2772
+ horizontal and vertical error ranges.
2783
2773
2784
- %(Line2D)s
2774
+ Other Parameters
2775
+ ----------------
2776
+ kwargs : All other keyword arguments are passed on to the plot
2777
+ command for the markers. For example, this code makes big red
2778
+ squares with thick green edges::
2785
2779
2786
- Returns (*plotline*, *caplines*, *barlinecols*):
2780
+ x,y,yerr = rand(3,10)
2781
+ errorbar(x, y, yerr, marker='s', mfc='red',
2782
+ mec='green', ms=20, mew=4)
2787
2783
2788
- *plotline*: :class:`~matplotlib.lines.Line2D` instance
2789
- *x*, *y* plot markers and/or line
2784
+ where mfc, mec, ms and mew are aliases for the longer
2785
+ property names, markerfacecolor, markeredgecolor, markersize
2786
+ and markeredgewidth.
2790
2787
2791
- *caplines*: list of error bar cap
2792
- :class:`~matplotlib.lines.Line2D` instances
2793
- *barlinecols*: list of
2794
- :class:`~matplotlib.collections.LineCollection` instances for
2795
- the horizontal and vertical error ranges.
2788
+ valid kwargs for the marker properties are
2796
2789
2797
- **Example:**
2790
+ %(Line2D)s
2798
2791
2792
+ Examples
2793
+ --------
2799
2794
.. plot:: mpl_examples/statistics/errorbar_demo.py
2800
-
2801
2795
"""
2802
2796
kwargs = cbook .normalize_kwargs (kwargs , _alias_map )
2803
2797
kwargs .setdefault ('zorder' , 2 )
0 commit comments