回答編集履歴
1
figでないとだめ
answer
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
プロットを行うタイミングでラベルを指定するのが一番やりやすいかと思います。
|
|
2
2
|
|
|
3
|
+
`Figure.legend`より存在するプロットすべてのラベルを凡例に反映できます。
|
|
4
|
+
|
|
5
|
+
[matplotlib.figure.Figure — Matplotlib 3.1.1 documentation](https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.figure.Figure.html#matplotlib.figure.Figure.legend)
|
|
6
|
+
|
|
3
7
|
```python
|
|
4
8
|
ax1.plot(hist1_acc_t, label="acc", color="red")
|
|
5
9
|
ax1.plot(hist1_acc_v, label="val_acc", color="orange")
|
|
@@ -8,7 +12,7 @@
|
|
|
8
12
|
|
|
9
13
|
# 中略
|
|
10
14
|
|
|
11
|
-
|
|
15
|
+
fig.legend(ncol=2)
|
|
12
16
|
|
|
13
17
|
|
|
14
18
|
```
|