mirror of
https://github.com/kernc/backtesting.py.git
synced 2024-01-28 15:29:30 +03:00
BUG: Fix plot not saved as specified filename if run within notebook
Fixes https://github.com/kernc/backtesting.py/issues/45
This commit is contained in:
@@ -49,14 +49,12 @@ with open(os.path.join(os.path.dirname(__file__), 'autoscale_cb.js'),
|
|||||||
|
|
||||||
def _bokeh_reset(filename=None):
|
def _bokeh_reset(filename=None):
|
||||||
curstate().reset()
|
curstate().reset()
|
||||||
# Test if we are in Jupyter notebook
|
if filename:
|
||||||
if IS_JUPYTER_NOTEBOOK:
|
|
||||||
curstate().output_notebook()
|
|
||||||
elif filename:
|
|
||||||
if not filename.endswith('.html'):
|
if not filename.endswith('.html'):
|
||||||
filename += '.html'
|
filename += '.html'
|
||||||
|
|
||||||
output_file(filename, title=filename)
|
output_file(filename, title=filename)
|
||||||
|
elif IS_JUPYTER_NOTEBOOK:
|
||||||
|
curstate().output_notebook()
|
||||||
|
|
||||||
|
|
||||||
def colorgen():
|
def colorgen():
|
||||||
|
|||||||
Reference in New Issue
Block a user