回答編集履歴
1
質問内容の勘違いによる回答の過ちの訂正
test
CHANGED
@@ -1,19 +1,21 @@
|
|
1
|
-
|
1
|
+
散布図の各点にラベルを付けるにはannotateを使うそうです。
|
2
2
|
|
3
|
-
|
3
|
+
```python
|
4
4
|
|
5
|
-
|
5
|
+
import pandas as pd
|
6
6
|
|
7
|
-
|
7
|
+
from matplotlib import pylab as plt
|
8
8
|
|
9
|
+
df = pd.read_csv('test.csv')
|
9
10
|
|
11
|
+
fig = df.plot.scatter(y=u'うどん', x=u'乗客')
|
10
12
|
|
11
|
-
|
13
|
+
for k, v in df.iterrows():
|
12
14
|
|
13
|
-
|
15
|
+
fig.annotate(v[0], xy=(v[2],v[1]), size=15)
|
14
16
|
|
15
|
-
|
17
|
+
plt.show()
|
16
18
|
|
17
|
-
|
19
|
+
```
|
18
20
|
|
19
|
-
](http://
|
21
|
+
[参考にしたサイト](http://nekoyukimmm.hatenablog.com/entry/2015/10/08/224607)
|