<reponame>soujiro0725/finance-stats<filename>utils/plotly_in_colaboratory.py


def enable_plotly_in_cell():
  import IPython
  from plotly.offline import init_notebook_mode
  display(IPython.core.display.HTML('''
        <script src="/static/components/requirejs/require.js"></script>
  '''))
  init_notebook_mode(connected=False)
  
# run the following in every cell
enable_plotly_in_cell()


plyo.init_notebook_mode(connected=True)
def enable_plotly_in_cell():
  import IPython
  from plotly.offline import init_notebook_mode
  display(IPython.core.display.HTML('''
        <script src="/static/components/requirejs/require.js"></script>
  '''))
  init_notebook_mode(connected=False)
  
# run the following in every cell
enable_plotly_in_cell()


plyo.init_notebook_mode(connected=True)
<script src="/static/components/requirejs/require.js"></script> # run the following in every cell