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

前端 未结 8 1568
粉色の甜心
粉色の甜心 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:46

    From the quickstart in the README

    This displays a figure, while none of the other answers here worked for me:

    import plotly.graph_objs as go
    fig = go.FigureWidget()
    # Display an empty figure
    fig
    

    This (in a new cell) modifies the above plot with a bar and line chart:

    # Add a scatter chart
    fig.add_scatter(y=[2, 1, 4, 3])
    # Add a bar chart
    fig.add_bar(y=[1, 4, 3, 2])
    # Add a title
    fig.layout.title = 'Hello FigureWidget'
    

    If that doesn't work, make sure your install is good, e.g. pip install --user --upgrade plotly if you installed with pip

提交回复
热议问题