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

回答編集履歴

2

2を追加

2019/03/13 14:35

投稿

hayataka2049
hayataka2049

スコア30939

answer CHANGED
@@ -1,3 +1,4 @@
1
+ 1.
1
2
  面倒くさいですが、matplotlibのtextを直接叩いてください。
2
3
 
3
4
  ```python
@@ -7,4 +8,11 @@
7
8
  ax.text(x, y, y,
8
9
  horizontalalignment="center",
9
10
  verticalalignment="center")
11
+ ```
12
+
13
+ 2.
14
+ こちらもmatplotlibから。
15
+
16
+ ```python
17
+ ax.set_yticklabels(["", *df.index, ""])
10
18
  ```

1

途中送信

2019/03/13 14:35

投稿

hayataka2049
hayataka2049

スコア30939

answer CHANGED
@@ -1,8 +1,10 @@
1
- 面倒くさいですが、matplotlib
1
+ 面倒くさいですが、matplotlibのtextを直接叩いてください。
2
2
 
3
+ ```python
3
4
  ax = df.T.plot(figsize=(10, 5), ylim=(6, 0), marker='o', ms=20, legend=False)
4
5
  for x in range(len(df.columns)):
5
6
  for y in range(1, len(df.index)+1):
6
7
  ax.text(x, y, y,
7
8
  horizontalalignment="center",
8
- verticalalignment="center")
9
+ verticalalignment="center")
10
+ ```