'Figure'对象没有属性'show'

时间:2019-07-28 16:48:00

标签: python network-programming plotly networkx

Figure对象没有属性show

我正在尝试使用plotly可视化网络。我通过遵循https://plot.ly/python/network-graphs/创建了网络,但是在工作簿中看不到它。请帮助我。

Fig = go.Figure(data=[edge_trace, node_trace],
            layout=go.Layout(
                title='<br>Network graph made with Python',
                showlegend=False,
                hovermode='closest',
                margin=dict(b=20,l=5,r=5,t=40),
                annotations=[ dict(
                text="Python code: <a href='https://plot.ly/ipython-notebooks/network-graphs/'> https://plot.ly/ipython-notebooks/network-graphs/</a>",
                showarrow=False,
                xref="paper", yref="paper",
                x=0.005, y=-0.002 ) ],
                xaxis=dict(showgrid=False, zeroline=False, showticklabels=False),
                yaxis=dict(showgrid=False, zeroline=False, showticklabels=False)))
Fig.show()

它应该生成图形。

1 个答案:

答案 0 :(得分:0)

您可能需要升级到plotly的4.0.0版本。