You are reading an old version of the documentation (v1.5.3). For the latest version see https://matplotlib.org/stable/

Matplotlib 2.0.0rc2 is available

Install the release candidate now!

matplotlib

Travis-CI:

This Page

statistics example code: errorbar_demo.pyΒΆ

(Source code, png, hires.png, pdf)

../../_images/errorbar_demo1.png
"""
Demo of the errorbar function.
"""
import numpy as np
import matplotlib.pyplot as plt

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

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

Keywords: python, matplotlib, pylab, example, codex (see Search examples)