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

Previous topic

statistics example code: bxp_demo.py

Next topic

statistics example code: errorbar_demo_features.py

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)