回答編集履歴
1
d
answer
CHANGED
@@ -34,19 +34,21 @@
|
|
34
34
|
df = pd.read_csv(io.StringIO(data), index_col=0)
|
35
35
|
|
36
36
|
# 描画する。
|
37
|
-
ax =
|
37
|
+
fig, ax = plt.subplots(figsize=(20, 10), facecolor='w')
|
38
|
-
|
38
|
+
df.T.plot(marker='o', ms=20, legend=False, colormap='tab20', ax=ax)
|
39
39
|
|
40
40
|
for x in range(len(df.columns)):
|
41
41
|
for y in range(1, len(df.index) + 1):
|
42
42
|
ax.text(x, y, y, ha='center', va='center')
|
43
43
|
|
44
|
+
# X軸
|
45
|
+
ax.set_xticks(np.arange(len(df.index)))
|
46
|
+
ax.set_xticklabels(df.columns)
|
47
|
+
|
44
|
-
# Y軸
|
48
|
+
# Y軸
|
45
49
|
ax.yaxis.tick_right()
|
46
|
-
|
47
|
-
# Y軸のラベル表示
|
48
50
|
ax.set_yticks(np.arange(1, len(df.index) + 1))
|
49
51
|
ax.set_yticklabels(df.index, fontsize=16)
|
50
52
|
```
|
51
53
|
|
52
|
-

|