File tree 3 files changed +11
-2
lines changed
3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -62,4 +62,4 @@ Please use explicit commit messages. See [NumPy's development workflow]
62
62
for inspiration.
63
63
64
64
[ code-review ] : https://mtlynch.io/code-review-love/
65
- [ NumPy's development workflow ] : https://docs.scipy. org/doc/numpy /dev/gitwash /development_workflow.html
65
+ [ NumPy's development workflow ] : https://numpy. org/doc/stable /dev/development_workflow.html
Original file line number Diff line number Diff line change @@ -615,7 +615,8 @@ def __eq__(self, other):
615
615
616
616
for f in plots :
617
617
if f .legend :
618
- f .legend .location = 'top_left' if show_legend else None
618
+ f .legend .visible = show_legend
619
+ f .legend .location = 'top_left'
619
620
f .legend .border_line_width = 1
620
621
f .legend .border_line_color = '#333333'
621
622
f .legend .padding = 5
Original file line number Diff line number Diff line change @@ -642,6 +642,14 @@ def test_params(self):
642
642
with self .subTest (param = p [0 ]):
643
643
bt .plot (** dict ([p ]), filename = f , open_browser = False )
644
644
645
+ def test_hide_legend (self ):
646
+ bt = Backtest (GOOG .iloc [:100 ], SmaCross )
647
+ bt .run ()
648
+ with _tempfile () as f :
649
+ bt .plot (filename = f , show_legend = False )
650
+ # Give browser time to open before tempfile is removed
651
+ time .sleep (5 )
652
+
645
653
def test_resolutions (self ):
646
654
with _tempfile () as f :
647
655
for rule in 'LSTHDWM' :
You can’t perform that action at this time.
0 commit comments