2 import matplotlib.pyplot as plt
5 x = np.arange(0.1, 4, 0.5)
8 # example error bar values that vary with x-position
11 fig, (ax0, ax1) = plt.subplots(nrows=2, sharex=True)
12 ax0.errorbar(x, y, yerr=error, fmt='-o')
13 ax0.set_title('variable, symmetric error')
15 # error bar values w/ different -/+ errors that
16 # also vary with the x-position
17 lower_error = 0.4 * error
19 asymmetric_error = [lower_error, upper_error]
21 ax1.errorbar(x, y, xerr=asymmetric_error, fmt='o')
22 ax1.set_title('variable, asymmetric error')