这展示了误差棒方法的最基本用法。在这种情况下在x方向和y方向上都提供了常数值作为误差。import matplotlib.pyplot as plt import numpy as np # 样例数据 x np.arange(0.1, 4, 0.5) y np.exp(-x) fig, ax plt.subplots() ax.errorbar(x, y, xerr0.2, yerr0.4) plt.show()参考文献https://matplotlib.org/stable/gallery/statistics/errorbar.html
Python绘制误差函数图
这展示了误差棒方法的最基本用法。在这种情况下在x方向和y方向上都提供了常数值作为误差。import matplotlib.pyplot as plt import numpy as np # 样例数据 x np.arange(0.1, 4, 0.5) y np.exp(-x) fig, ax plt.subplots() ax.errorbar(x, y, xerr0.2, yerr0.4) plt.show()参考文献https://matplotlib.org/stable/gallery/statistics/errorbar.html