Skip to content

Instantly share code, notes, and snippets.

@joostmeijles
Created November 10, 2015 19:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joostmeijles/9046f81bcd964affc8db to your computer and use it in GitHub Desktop.
Save joostmeijles/9046f81bcd964affc8db to your computer and use it in GitHub Desktop.
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)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment