Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Plot simple errorbar using pyplot
import numpy as np
import matplotlib.pyplot as plt
# example data
x = np.arange(0.5, 5.5, 0.5)
print x
y = np.exp(-x)
print y
yerr = np.zeros(x.shape) + 0.2
yerr[[3, 6]] = 0.3
print yerr
plt.errorbar(x, y + 2.1, yerr=yerr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment