On Apr 16, 9:52 pm, nkulmati <[email protected]> wrote:
> Hello All,
>
> I have a simple script:
>
> > G = graphs.RandomNGP(20, 0.05)
> > centralities = G.centrality_closeness()
>
> I can not figure out how to plot the graph G so that no only the
> labels (1,2,3) are shown but also the corresponding centralities from
> the dictionary "centralities"!
>
> Does anyone have any idea??
>
> Also, is it possible to plot the vertices in different, pre-specified
> colors?? (Sounds like a common task for bipartite graph visualization)
>
> Thanks !!!

Note sure if this is what you're looking for, but the folliwing code
might be useful

G = graphs.RandomGNP(20, 0.05)
centralities = G.centrality_closeness()
d={}
for k in centralities:
    d[k]=(k,centralities[k])

G.relabel(d)
G.plot(layout="spring",vertex_size=2000).show(figsize=[20,20])


Sage is not very happy to draw graphs.

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to