Matplotlib.pyplot.errorbar() in Python Last Updated : 21 Apr, 2020 Comments Improve Suggest changes Like Article Like Report Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. matplotlib.pyplot.errorbar() Function: The errorbar() function in pyplot module of matplotlib library is used to plot y versus x as lines and/or markers with attached errorbars. Syntax: matplotlib.pyplot.errorbar(x, y, yerr=None, xerr=None, fmt='', ecolor=None, elinewidth=None, capsize=None, barsabove=False, lolims=False, uplims=False, xlolims=False, xuplims=False, errorevery=1, capthick=None, \*, data=None, \*\*kwargs) Parameters: This method accept the following parameters that are described below: x, y: These parameter are the horizontal and vertical coordinates of the data points. fmt: This parameter is an optional parameter and it contains the string value. xerr, yerr: These parameter contains an array.And the error array should have positive values. ecolor: This parameter is an optional parameter. And it is the color of the errorbar lines with default value NONE. elinewidth: This parameter is also an optional parameter. And it is the linewidth of the errorbar lines with default value NONE. capsize: This parameter is also an optional parameter. And it is the length of the error bar caps in points with default value NONE. barsabove: This parameter is also an optional parameter. It contains boolean value True for plotting errorsbars above the plot symbols.Its default value is False. lolims, uplims, xlolims, xuplims: These parameter are also an optional parameter. They contain boolean values which is used to indicate that a value gives only upper/lower limits. errorevery: This parameter is also an optional parameter. They contain integer values which is used to draws error bars on a subset of the data. Returns: This returns the container and it is comprises of the following: plotline:This returns the Line2D instance of x, y plot markers and/or line. caplines:This returns the tuple of Line2D instances of the error bar caps. barlinecols:This returns the tuple of LineCollection with the horizontal and vertical error ranges. Below examples illustrate the matplotlib.pyplot.errorbar() function in matplotlib.pyplot: Example #1: Python3 1== # Implementation of matplotlib function import numpy as np import matplotlib.pyplot as plt # example data xval = np.arange(0.1, 4, 0.5) yval = np.exp(-xval) plt.errorbar(xval, yval, xerr = 0.4, yerr = 0.5) plt.title('matplotlib.pyplot.errorbar() function Example') plt.show() Output: Example #2: Python3 1== # Implementation of matplotlib function import numpy as np import matplotlib.pyplot as plt fig = plt.figure() x = np.arange(10) y = 3 * np.sin(x / 20 * np.pi) yerr = np.linspace(0.05, 0.2, 10) plt.errorbar(x, y + 7, yerr = yerr, label ='Line1') plt.errorbar(x, y + 5, yerr = yerr, uplims = True, label ='Line2') plt.errorbar(x, y + 3, yerr = yerr, uplims = True, lolims = True, label ='Line3') upperlimits = [True, False] * 5 lowerlimits = [False, True] * 5 plt.errorbar(x, y, yerr = yerr, uplims = upperlimits, lolims = lowerlimits, label ='Line4') plt.legend(loc ='upper left') plt.title('matplotlib.pyplot.errorbar()\ function Example') plt.show() Output: Comment More infoAdvertise with us Next Article Matplotlib.pyplot.errorbar() in Python S SHUBHAMSINGH10 Follow Improve Article Tags : Python Python-matplotlib Practice Tags : python Similar Reads Matplotlib.pyplot.draw() in Python Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. matplotlib.pyplot.draw() Function The draw() function in pyplot module of matplotlib library is used to r 1 min read Matplotlib.pyplot.gca() in Python Matplotlib is a library in Python and it is a numerical - mathematical extension for the NumPy library. Pyplot is a state-based interface to a Matplotlib module that provides a MATLAB-like interface.  matplotlib.pyplot.gca() Function The gca() function in pyplot module of matplotlib library is used 2 min read Matplotlib.pyplot.copper() in Python Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. matplotlib.pyplot.copper() Function The copper() function in pyplot module of matplotlib library is used 2 min read Matplotlib.pyplot.grid() in Python matplotlib.pyplot.grid() function in Matplotlib is used to toggle the visibility of grid lines in a plot. Grid lines help improve readability of a plot by adding reference lines at major and/or minor tick positions along the axes. Example:Pythonimport matplotlib.pyplot as plt fig, ax = plt.subplots( 3 min read Matplotlib.pyplot.flag() in Python Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. matplotlib.pyplot.flag() Function The flag() function in pyplot module of matplotlib library is used to s 2 min read Matplotlib.pyplot.axes() in Python axes() method in Matplotlib is used to create a new Axes instance (i.e., a plot area) within a figure. This allows you to specify the location and size of the plot within the figure, providing more control over subplot layout compared to plt.subplot(). It's key features include:Creates a new Axes at 3 min read Matplotlib.pyplot.bone() in Python Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. There are various plots which can be used in Pyplot are Line Plot, Contour, Histogram, Scatter, 3D Plot, 2 min read Matplotlib.pyplot.gci() in Python Matplotlib is a library in Python and it is numerical â mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. There are various plots which can be used in Pyplot are Line Plot, Contour, Histogram, Scatter, 3D Plot, 2 min read matplotlib.pyplot.figure() in Python Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. There are various plots which can be used in Pyplot are Line Plot, Contour, Histogram, Scatter, 3D Plot, 2 min read Matplotlib.pyplot.annotate() in Python Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. matplotlib.pyplot.annotate() Function The annotate() function in pyplot module of matplotlib library is u 3 min read Like