I'm searching for a way to draw shaded error-regions instead of error-bars in Python.
I know that there is matplotlib.pyplot.fill_between()
with which you can build a workaround for the y-error but that does not include the x-uncertainty.
Any ideas? Unfortunately I had not enough reputation to put a comment here.
Thanks in advance!
Edit
matplotlib.pyplot.fill_betweenx()
leads to something like:
Edit 2
Furthermore I suppose it to be incorrect for a complete uncertainty area. Below I draw what I suppose to be the correct shape - I hope, I'm not wrong here...
import numpy as np
import matplotlib.pyplot as plt
x = np.asarray([1.0, 2.0, 3.0, 4.0])
y = np.asarray([1.0, 2.3, 3.0, 4.0])
xerr = np.asarray([0.1, 0.7, 0.1, 0.1])
yerr = np.asarray([0.1, 0.9, 1.2, 0.1])
plt.errorbar(x, y, yerr, xerr)
plt.fill_between(x, y-yerr, y+yerr, facecolor='#F0F8FF', alpha=1.0, edgecolor='none')
plt.fill_betweenx(y,x-xerr, x+xerr, facecolor='#F0F8FF', alpha=1.0, edgecolor='#8F94CC', linewidth=1, linestyle='dashed')
plt.show()
# Red lines added with inkscape.