plt.scatter(xlist, ylist)
plt.errorbar(x_ave, y_ave, yerr=1, xerr=1, fmt='*', color='red', ecolor='black', ms=20,
elinewidth=4, capsize=10, capthick=4, label='Average')
handles, labels = ax.get_legend_handles_labels()
handles = [h[0] for h in handles]
ax.legend(handles, labels, loc='best', fontsize=16)
![](https://img.haomeiwen.com/i635081/073ec67a4ecabe16.png)
pylab_examples example code: errorbar_demo.py
![](https://img.haomeiwen.com/i635081/96008fbb9ec8b9a5.png)
sphx-glr-gallery-lines-bars-and-markers-errorbar-limits-simple
![](https://img.haomeiwen.com/i635081/867999cd3bfe61ce.png)
plt.errorbar(x, y, yerr=dy, fmt='o', color='black',
ecolor='lightgray', elinewidth=3, capsize=0);
![](https://img.haomeiwen.com/i635081/5de79454b396283e.png)
网友评论