質問するログイン新規登録

回答編集履歴

1

画像追加

2018/02/18 02:56

投稿

wakame
wakame

スコア1170

answer CHANGED
@@ -1,1 +1,16 @@
1
+ 求めているのがどっちかわからなかったのでどっちもやってみました。
2
+ ```python
3
+ import matplotlib
4
+ import matplotlib.pyplot as plt
5
+
6
+ x = [1,2,3,4,5]
7
+ y = [10,20,30,40,50]
8
+ yerr = [[2, 1, 3, 3, 2], [4, 3, 4, 2, 4]]
9
+ plt.errorbar(x,y,yerr,label="", fmt='ro', ecolor='g')
10
+ plt.show()
11
+ plt.errorbar(x,y,xerr=yerr[0], yerr=yerr[1],label="", fmt='ro', ecolor='g')
12
+ plt.show()
13
+ ```
14
+ ![only_yerr](dd56e4b04da20172e312d6f995a83196.png)
15
+ ![split_xerr_yerr](e8164f8f11aa5eb02d26fe791a0250a6.png)
1
16
  [pylab_examples example code: errorbar_demo.py](https://matplotlib.org/1.2.1/examples/pylab_examples/errorbar_demo.html)