0

I am trying to display a NetworkX graph inside my Flask application, using matplotlib and the mpld3 library.

    f=plt.figure()
    pos=nx.spring_layout(G)

    nx.draw_networkx_nodes(G,pos,nodelist=nodes, node_color='r', node_size=50, alpha=0.8,with_labels=True)
    nx.draw_networkx_edges(G,pos,width=1.0,alpha=0.5)

    graph=mpld3.fig_to_html(f)

On my local machine, the graph looks fine, like this:

enter image description here

On Heroku, however, the graph is rendered like this:

enter image description here

With the exact same data and code in local and heroku, I am unable to figure out why the Heroku graph looks so different. What might be wrong?

Avijit
  • 391
  • 2
  • 21

0 Answers0