| [ Web Proxy ] |
| Viewing: https://matplotlib.org/gallery/mplot3d/../widgets/../statistics/errorbar_limits_simple.html | [Back] [Original] |
Section Navigation
fill_between with transparencyhisttype settingsplt.subplotsfloating_axes featuresNote
Go to the end to download the full example code.
Illustration of selectively drawing lower and/or upper limit symbols on
errorbars using the parameters uplims, lolims of errorbar.
Alternatively, you can use 2xN values to draw errorbars in only one direction.
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure()
x = np.arange(10)
y = 2.5 * np.sin(x / 20 * np.pi)
yerr = np.linspace(0.05, 0.2, 10)
plt.errorbar(x, y + 3, yerr=yerr, label='both limits (default)')
plt.errorbar(x, y + 2, yerr=yerr, uplims=True, label='uplims=True')
plt.errorbar(x, y + 1, yerr=yerr, uplims=True, lolims=True,
label='uplims=True, lolims=True')
upperlimits = [True, False] * 5
lowerlimits = [False, True] * 5
plt.errorbar(x, y, yerr=yerr, uplims=upperlimits, lolims=lowerlimits,
label='subsets of uplims and lolims')
plt.legend(loc='lower right')
[errorbar limits simple]Similarly xuplims and xlolims can be used on the horizontal xerr
errorbars.
fig = plt.figure()
x = np.arange(10) / 10
y = (x + 0.1)**2
plt.errorbar(x, y, xerr=0.1, xlolims=True, label='xlolims=True')
y = (x + 0.1)**3
plt.errorbar(x + 0.6, y, xerr=0.1, xuplims=upperlimits, xlolims=lowerlimits,
label='subsets of xuplims and xlolims')
y = (x + 0.1)**4
plt.errorbar(x + 1.2, y, xerr=0.1, xuplims=True, label='xuplims=True')
plt.legend()
plt.show()
[errorbar limits simple]References
The use of the following functions, methods, classes and modules is shown in this example:
Tags: component: error plot-type: errorbar level: beginner
Total running time of the script: (0 minutes 1.098 seconds)
Copyright 20022012 John Hunter, Darren Dale, Eric Firing, Michael Droettboom and the Matplotlib development team; 20122026 The Matplotlib development team.
Created using Sphinx 9.1.0.
Built from v3.11.2-1-g879ad8ebba.
Built with the PyData Sphinx Theme 0.16.1.
| Web Proxy Viewer | New URL | Original Page |