回答編集履歴
1
画像追加
test
CHANGED
@@ -1 +1,31 @@
|
|
1
|
+
求めているのがどっちかわからなかったのでどっちもやってみました。
|
2
|
+
|
3
|
+
```python
|
4
|
+
|
5
|
+
import matplotlib
|
6
|
+
|
7
|
+
import matplotlib.pyplot as plt
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
x = [1,2,3,4,5]
|
12
|
+
|
13
|
+
y = [10,20,30,40,50]
|
14
|
+
|
15
|
+
yerr = [[2, 1, 3, 3, 2], [4, 3, 4, 2, 4]]
|
16
|
+
|
17
|
+
plt.errorbar(x,y,yerr,label="", fmt='ro', ecolor='g')
|
18
|
+
|
19
|
+
plt.show()
|
20
|
+
|
21
|
+
plt.errorbar(x,y,xerr=yerr[0], yerr=yerr[1],label="", fmt='ro', ecolor='g')
|
22
|
+
|
23
|
+
plt.show()
|
24
|
+
|
25
|
+
```
|
26
|
+
|
27
|
+
![only_yerr](dd56e4b04da20172e312d6f995a83196.png)
|
28
|
+
|
29
|
+
![split_xerr_yerr](e8164f8f11aa5eb02d26fe791a0250a6.png)
|
30
|
+
|
1
31
|
[pylab_examples example code: errorbar_demo.py](https://matplotlib.org/1.2.1/examples/pylab_examples/errorbar_demo.html)
|