'Scatter plot and errorbar plot in one figure
I am trying to have a scatter plot from my points on top of my error bar plot. However, my error bars cover my scatter points. Do you have any suggestion how those scatter points can be on top of my error bar and not behind the error lines?
Here is a mock example:
a = [1, 2, 3, 4, 5]
b = [0.3, 2.2, 2.6, 3.5, 4.7]
plt.errorbar(range(len(a)), np.array(a),
yerr=(np.array(a) - 0.3, np.array(a) + 0.3),fmt="o",
color="green", ecolor="lightgreen", elinewidth=2.5, capsize=1)
plt.scatter(range(len(b)), np.array(b), marker="x", color="blue", s=10)
plt.show()
And here is my figure:
So, I want those blue scatter points place above the green errobar.
I would appreciate a lot if someone can give me any idea.
Many thanks !
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

