How to make error bars in matplotlib python

Veröffentlicht am: 05 June 2019
auf dem Kanal: Karina Adcock
36,778
741

In this video I show you how to add error bars to a chart using matplotlib in python and the various options that are available. How to add variable error bars. How to make symmetrical and asymmetrical error bars. How to format error bars.

Matplotlib error bars webpage: https://matplotlib.org/api/_as_gen/ma...

import matplotlib.pyplot as plt

x = [1,2,3,4,5]
y = [1,2,1,2,1]
yerrormin = [0.1,0.5,0.9,0.1,0.9]
yerrormax = [0.2,0.4,0.6,0.4,0.2]
xerror = 0.5

yerror = [yerrormin, yerrormax]

plt.plot(x,y,'o')

plt.errorbar(x,y,yerr=yerror, xerr=xerror, fmt='o', ecolor='black', elinewidth=2, capsize=5,
capthick=2, barsabove=False, errorevery=1, lolims=True, uplims=True, xlolims=True,
xuplims=True, alpha=1, ms=10)

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)

plt.show()

--------------------------------------------------------------------------------
#python #matplotlib

SUBSCRIBE: https://goo.gl/c46YPs

Jupyter notebook/ Python 3/ Anaconda 3
---------------------------------------------------------------------------------
IF YOU LIKED THIS VIDEO YOU MAY ALSO LIKE:
How to make a map in python using basemap:    • How to make a map in python using bas...  
How to plot latitude and longitude co-ordinates in basemap:    • How to plot latitude and longitude co...  
How to add annotations to basemap in python    • How to add annotations to basemap in ...  


Auf dieser Seite können Sie das Online-Video How to make error bars in matplotlib python mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Karina Adcock 05 June 2019 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 36,778 Mal angesehen und es wurde von 741 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!