File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Expand file tree Collapse file tree 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]
6262for inspiration.
6363
6464[ 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):
615615
616616 for f in plots :
617617 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'
619620 f .legend .border_line_width = 1
620621 f .legend .border_line_color = '#333333'
621622 f .legend .padding = 5
Original file line number Diff line number Diff line change @@ -642,6 +642,14 @@ def test_params(self):
642642 with self .subTest (param = p [0 ]):
643643 bt .plot (** dict ([p ]), filename = f , open_browser = False )
644644
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+
645653 def test_resolutions (self ):
646654 with _tempfile () as f :
647655 for rule in 'LSTHDWM' :
You canβt perform that action at this time.
0 commit comments