You are reading an old version of the documentation (v2.1.2). For the latest version see https://matplotlib.org/stable/gallery/statistics/errorbar.html
Version 2.1.2
matplotlib
Fork me on GitHub


Travis-CI:

Related Topics

This Page

Errorbar functionΒΆ

This exhibits the most basic use of the error bar method. In this case, constant values are provided for the error in both the x- and y-directions.

../../_images/sphx_glr_errorbar_001.png
import numpy as np
import matplotlib.pyplot as plt

# example data
x = np.arange(0.1, 4, 0.5)
y = np.exp(-x)

fig, ax = plt.subplots()
ax.errorbar(x, y, xerr=0.2, yerr=0.4)
plt.show()

Total running time of the script: ( 0 minutes 0.020 seconds)

Gallery generated by Sphinx-Gallery