On 30.04.2015 11:34, marten wrote:
> I am trying to visualise a bipartite network (graphml, created with
> networkx), where node types are represented by vertex shape and other vertex
> attributes such as party affiliation by vertex colour and/or size.
>
> I would be very grateful for a code sample which could help illustrate
> how such non-computed attributes are retrieved from loaded graphml
> file and assigned to the graph. I was not able to figure this out
> reading through the documentation.

Did you read the documentation about property maps?

For vertex property maps stored in a file, you would access them as:


    g = load_graph("mygraph.xml")
    size = g.vp["size"]

    # print all sizes

    for v in g.vertices():
        print(size[v])

See https://graph-tool.skewed.de/static/doc/quickstart.html#property-maps
for more information.

Best,
Tiago

-- 
Tiago de Paula Peixoto <[email protected]>

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
graph-tool mailing list
[email protected]
http://lists.skewed.de/mailman/listinfo/graph-tool

Reply via email to