Matplotlib: plot indicating the precision of measurements I have some data with some margin of error and am using numpy arrays to plot that data. Assuming the precision is, let's say, 0.05 or 0.03grams, then the data will be something like 

[4.0 $\pm$ 0.05, 3.05 $\pm$ 0.03]

How can I show this on my plot (either on the x axis or the y axis. If it's both, even better)?

I use pyplot and my OS is macOS
One can use the matplotlib.axes.Axes.errorbar class.

From this example in the documentation:

# example error bar values that vary with x-position
error = 0.1 + 0.2 * x

fig, (ax0, ax1) = plt.subplots(nrows=2, sharex=True)
ax0.errorbar(x, y, yerr=error, fmt='-o')
ax0.set_title('variable, symmetric error')


Acknowledgments: Thanks to Emre!