Example #1
0
def draw_graph_spectral(y, clusters='blue', ns=30):
    G = nxG(y)
    pos = graphviz_layout(G, prog='twopi', args='')
    plt.figure()
    nx.draw_spectral(G,
                     cmap=plt.get_cmap('jet'),
                     node_color=clusters,
                     node_size=30,
                     with_labels=False)
Example #2
0
def draw_graph_spring(y, clusters='blue', ns=30):
    G = nxG(y)

    plt.figure()
    nx.draw_spring(G,
                   cmap=plt.get_cmap('jet'),
                   node_color=clusters,
                   node_size=30,
                   with_labels=False)
Example #3
0
def draw_graph_circular(y, clusters='blue', ns=30):
    G = nxG(y)
    pos = graphviz_layout(G, prog='twopi', args='')
    plt.figure()
    nx.draw(G,
            pos,
            node_size=ns,
            alpha=0.8,
            node_color=clusters,
            with_labels=False)
    plt.axis('equal')