@@ -30,12 +30,12 @@ def plot():
30
30
31
31
# Legend best location is "center left"
32
32
l , = axes [4 ].plot (t [30 :], 2 * np .cos (10 * t [30 :]), linewidth = 0.5 )
33
- l2 , l3 = axes [4 ].plot (t , - 1.5 * np .ones_like (t ), t , 1.5 * np .ones_like (t ))
33
+ axes [4 ].plot (t , - 1.5 * np .ones_like (t ), t , 1.5 * np .ones_like (t ))
34
34
axes [4 ].legend ((l ,), ('CL' ,), loc = 0 )
35
35
36
36
# Legend best location is "center right"
37
37
l , = axes [5 ].plot (t [:30 ], 2 * np .cos (10 * t [:30 ]), linewidth = 0.5 )
38
- l2 , l3 = axes [5 ].plot (t , - 1.5 * np .ones_like (t ), t , 1.5 * np .ones_like (t ))
38
+ axes [5 ].plot (t , - 1.5 * np .ones_like (t ), t , 1.5 * np .ones_like (t ))
39
39
axes [5 ].legend ((l ,), ('CR' ,), loc = 0 )
40
40
41
41
# Legend best location is "lower center"
@@ -47,9 +47,14 @@ def plot():
47
47
axes [7 ].legend ((l ,), ('UC' ,), loc = 0 )
48
48
49
49
# Legend best location is "center"
50
- l , l1 = axes [8 ].plot (t [:10 ], 2 * np .cos (10 * t [:10 ]), t [- 10 :],
51
- 2 * np .cos (10 * t [- 10 :]), linewidth = 0.5 )
52
- l2 , l3 = axes [8 ].plot (t , - 2 * np .ones_like (t ), t , 2 * np .ones_like (t ))
50
+ l , = axes [8 ].plot (
51
+ t [:10 ],
52
+ 2 * np .cos (10 * t [:10 ]),
53
+ t [- 10 :],
54
+ 2 * np .cos (10 * t [- 10 :]),
55
+ linewidth = 0.5
56
+ )
57
+ axes [8 ].plot (t , - 2 * np .ones_like (t ), t , 2 * np .ones_like (t ))
53
58
axes [8 ].legend ((l ,), ('C' ,), loc = 0 )
54
59
55
60
return fig
0 commit comments