def draw_street_graph(networkx_graph, node_index):
"""
This function draws the networkx graph and visualise it.
PARAMETERS
----------
networkx_graph : networkx graph class instance
The networkx graph to be visualised.
node_index : list of floats
The index of the nodes in the networkx graph.
"""
import matplotlib.pyplot as plt
node_pos = {}
ntcnt = 0
for np in node_index:
node_pos[ntcnt] = (np[0],np[1])
ntcnt+=1
nx.draw_networkx_labels(networkx_graph,pos=node_pos)
nx.draw_networkx_nodes(networkx_graph,node_pos, node_size = 10)
nx.draw_networkx_edges(networkx_graph,node_pos,width=1.0,alpha=0.5)
plt.show()
#================================================================================================================
#NSHFAI
#================================================================================================================
评论列表
文章目录