plotly.offline.iplot gives a large blank field as its output in Jupyter Notebook/Lab

前端 未结 8 1580
粉色の甜心
粉色の甜心 2020-12-17 09:17

I am trying to create a Sankey chart in a Jupyter notebook, basing my code on the first example shown here.

I ended up with this, which I can run without getting any

8条回答
  •  旧巷少年郎
    2020-12-17 09:44

    I can get the correct display with jupyter notebook server (without any additional options), but get a blank block with jupyter lab server. Related version info:

    $ jupyter lab --version
    0.35.5
    $ jupyter notebook --version
    5.7.8
    $ python -c "import plotly; print(plotly.__version__)"
    3.10.0
    

    So for those who are using JupyterLab, to properly display the offline plotly graphs in JupyterLab, we need to install the plotly-extension with following commands (following is excerpted from a related answer):

    $ jupyter labextension install @jupyterlab/plotly-extension
    $ jupyter labextension list 
    $ jupyter lab build
    

提交回复
热议问题