Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchUse Matplotlib’s Axes.errorbar() method to plot data points with horizontal and/or vertical error bars. For a marker-only scatter-style plot, set fmt='o' and linestyle='none'.
Make a scatter plot with vertical error bars
This example adds symmetric y-error bars to four points. The values in yerr are the uncertainty magnitudes for each point.
import matplotlib.pyplot as plt
x = [1, 2, 3, 4]
y = [2.1, 2.8, 3.2, 4.3]
yerr = [0.2, 0.3, 0.15, 0.25]
fig, ax = plt.subplots()
ax.errorbar(x, y, yerr=yerr, fmt='o', linestyle='none', capsize=3)
ax.set_xlabel('x')
ax.set_ylabel('y')
plt.show()
fmt='o' selects circular data markers, and linestyle='none' prevents Matplotlib from connecting them. capsize=3 sets the cap length. The default cap size is 0.0, so specify a value when you want visible caps. Matplotlib errorbar API
Choose the right error-array shape
Error amounts must be nonnegative. A scalar applies the same symmetric error to every point; an array with one value per point gives each point its own symmetric error. Use a two-row array when lower and upper errors differ. Matplotlib errorbar API Matplotlib error-bar examples
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →#1 Best Overall
| Input shape | Meaning |
|---|---|
| Scalar | Same symmetric error magnitude for every point. |
(N,) |
One symmetric error magnitude per point; N is the number of data points. |
(2, N) |
Asymmetric errors per point: first row is the lower amount, second row is the upper amount. |
For example, pass separate lower and upper y-error magnitudes in that order:
lower = [0.1, 0.2, 0.1, 0.15]
upper = [0.25, 0.3, 0.2, 0.3]
ax.errorbar(x, y, yerr=[lower, upper], fmt='o', linestyle='none')
Do not represent a downward error with a negative number. Supply its positive magnitude in the lower row instead; reversing the rows swaps the intended lower and upper extents.
Rank #2
Add horizontal error bars or omit markers
Pass xerr for horizontal uncertainty and yerr for vertical uncertainty. You can provide either argument alone or both:
ax.errorbar(x, y, xerr=xerr, yerr=yerr, fmt='o', linestyle='none')
To draw error bars without data markers, use fmt='none'. For example: ax.errorbar(x, y, yerr=yerr, fmt='none'). Matplotlib errorbar API
Adjust the appearance and reduce clutter
capsizesets the length of the end caps.ecolorsets the error-bar color.erroreverydisplays error bars for a subset of data points when showing them all would make the plot difficult to read.
These options change the display, not the error magnitudes. See the errorbar API reference for the complete parameter list.
When to combine scatter() and errorbar()
Axes.errorbar() draws markers or lines along with error bars, making it the direct choice for a basic scatter plot with uncertainty. Use Axes.scatter() when you need its per-point marker-size or color controls. Because these are separate methods, you can layer a scatter call for the points with an errorbar call for the bars, suppressing the latter’s markers with fmt='none'. Matplotlib errorbar API Matplotlib scatter API
One-sided limits and inverted axes
If you use one-sided limit indicators on an inverted axis, set the axis limits before calling errorbar(). Matplotlib’s API notes that the order matters for these limit markers. Matplotlib errorbar API
Quick Recap
Best Value
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




