def draw_transmat_graph_inner(G, edge_threshold=0, lw=1, ec='0.2', node_size=15):
num_states = G.number_of_nodes()
edgewidth = [ d['weight'] for (u,v,d) in G.edges(data=True)]
edgewidth = np.array(edgewidth)
edgewidth[edgewidth<edge_threshold] = 0
npos=circular_layout(G, scale=1, direction='CW')
nx.draw_networkx_edges(G, npos, alpha=1.0, width=edgewidth*lw, edge_color=ec)
nx.draw_networkx_nodes(G, npos, node_size=node_size, node_color='k',alpha=1.0)
ax = plt.gca()
ax.set_aspect('equal')
return ax
评论列表
文章目录