You are reading documentation for the unreleased version of Matplotlib. Try searching for the released version of this page instead?
Version 3.0.2.post1971+g24524c430
matplotlib
Fork me on GitHub

Table of Contents

Related Topics

Errorbar Limits

Illustration of upper and lower limit symbols on errorbars.

import numpy as np
import matplotlib.pyplot as plt


fig = plt.figure()
x = np.arange(10)
y = np.sin(x / 20 * np.pi)
yerr = np.linspace(0.05, 0.2, 10)

plt.errorbar(x, y, yerr=yerr)

plt.errorbar(x, y + 1, yerr=yerr, uplims=True)

plt.errorbar(x, y + 2, yerr=yerr, uplims=True, lolims=True)

upperlimits = [True, False] * 5
lowerlimits = [False, True] * 5
plt.errorbar(x, y + 3, yerr=yerr, uplims=upperlimits, lolims=lowerlimits)
../../_images/sphx_glr_errorbar_limits_simple_001.png
fig = plt.figure()
x = np.arange(10) / 10
y = (x + 0.1)**2

plt.errorbar(x, y, xerr=0.1, xlolims=True)
y = (x + 0.1)**3

plt.errorbar(x + 0.6, y, xerr=0.1, xuplims=upperlimits, xlolims=lowerlimits)

y = (x + 0.1)**4
plt.errorbar(x + 1.2, y, xerr=0.1, xuplims=True)

plt.show()
../../_images/sphx_glr_errorbar_limits_simple_002.png

References

The use of the following functions, methods, classes and modules is shown in this example:

Keywords: matplotlib code example, codex, python plot, pyplot Gallery generated by Sphinx-Gallery