回答編集履歴

1

figでないとだめ

2019/10/17 04:48

投稿

hayataka2049
hayataka2049

スコア30933

test CHANGED
@@ -1,4 +1,12 @@
1
1
  プロットを行うタイミングでラベルを指定するのが一番やりやすいかと思います。
2
+
3
+
4
+
5
+ `Figure.legend`より存在するプロットすべてのラベルを凡例に反映できます。
6
+
7
+
8
+
9
+ [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)
2
10
 
3
11
 
4
12
 
@@ -18,7 +26,7 @@
18
26
 
19
27
 
20
28
 
21
- plt.legend(ncol=2)
29
+ fig.legend(ncol=2)
22
30
 
23
31
 
24
32