urbanformeval.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:py4design 作者: chenkianwee 项目源码 文件源码
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
#================================================================================================================
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号