1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-14 16:26:55 +08:00

Fix report, support google colab

This commit is contained in:
zhupr
2020-11-27 20:00:05 +08:00
parent 2311af5e47
commit f8101214eb
3 changed files with 51 additions and 8 deletions

View File

@@ -96,7 +96,19 @@ class BaseGraph(object):
"""
py.init_notebook_mode()
for _fig in figure_list:
py.iplot(_fig)
# NOTE: displays figures: https://plotly.com/python/renderers/
# default: plotly_mimetype+notebook
# support renderers: import plotly.io as pio; print(pio.renderers)
renderer = None
try:
# in notebook
_ipykernel = str(type(get_ipython()))
if 'google.colab' in _ipykernel:
renderer = 'colab'
except NameError:
pass
_fig.show(renderer=renderer)
def _get_layout(self) -> go.Layout:
"""