graph.py 文件源码

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

项目:nelpy 作者: nelpy 项目源码 文件源码
def draw_transmat_graph_outer(Go, Gi, edge_threshold=0, lw=1, ec='0.2', nc='k', node_size=15):

    num_states = Go.number_of_nodes()

    edgewidth = [ d['weight'] for (u,v,d) in Go.edges(data=True)]
    edgewidth = np.array(edgewidth)
    edgewidth[edgewidth<edge_threshold] = 0

    npos=double_circular_layout(Gi, scale=1, direction='CW')

    nx.draw_networkx_edges(Go, npos, alpha=1.0, width=edgewidth*lw, edge_color=ec)

    nx.draw_networkx_nodes(Go, npos, node_size=node_size, node_color=nc,alpha=1.0)

    ax = plt.gca()
    ax.set_aspect('equal')

    return ax
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号