✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🐍Plotly, Coiled CEOs Discuss Partnering & ML Experts show us how Dash + Dask apps work Register for the Webinar.

Plotly2.5.1 and networkx 2.1 figure blank in jupyter offline

I followed this tutorial https://plot.ly/python/network-graphs/#create-network-graph
only made a little change with networkx: adjacency_list to generate_adjlist

image

@maerkeov When you want to get help paste your Python code here, pls, instead of uploading a jpg image!

Looking at your image I can see that is missing
import plotly

I downloaded the original code and performed the following changes:

Inserted:

from plotly.offline import download_plotlyjs, init_notebook_mode,  iplot, plot
init_notebook_mode(connected=True)

and replaced the Graph attribute adjacency_list, valid before the networkx version 2.0, with
adjacency, i.e.

for node, adjacencies in enumerate(G.adjacency()):
    node_trace['marker']['color'].append(len(adjacencies))
    node_info = '# of connections: '+str(len(adjacencies))
    node_trace['text'].append(node_info)

With these changes it works fine.

Thank you empet. The reason why I upload pic instead of paste text code is that I’
m using a jump server that I can’t paste anything out of that.:sob:

Did you run in jupyter and offline?
The jump server have no access to the wide-area internet:disappointed_relieved:

Yes, I ran the Jupyter Notebook offline.