Files
notes_estom/Python/matplotlab/gallery/statistics/errorbar.md
2020-09-26 22:03:11 +08:00

23 lines
642 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 误差条形图功能
这展示了误差条形图功能的最基本用法。在这种情况下为x方向和y方向的误差提供常数值。
![误差条形图示例](https://matplotlib.org/_images/sphx_glr_errorbar_001.png)
```python
import numpy as np
import matplotlib.pyplot as plt
# example data
x = np.arange(0.1, 4, 0.5)
y = np.exp(-x)
fig, ax = plt.subplots()
ax.errorbar(x, y, xerr=0.2, yerr=0.4)
plt.show()
```
## 下载这个示例
- [下载python源码: errorbar.py](https://matplotlib.org/_downloads/errorbar.py)
- [下载Jupyter notebook: errorbar.ipynb](https://matplotlib.org/_downloads/errorbar.ipynb)