Created
November 10, 2015 19:24
-
-
Save joostmeijles/9046f81bcd964affc8db to your computer and use it in GitHub Desktop.
Plot simple errorbar using pyplot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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