igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] appending and coloring nodes


From: Tamás Nepusz
Subject: Re: [igraph] appending and coloring nodes
Date: Sat, 16 Nov 2013 17:33:56 +0100

when all the nodes are loaded, if I want to color the proteins say in red and the genes say in blue, is that possible?

def is_protein(vertex):
    return vertex[“name”].startswith(“protein”)

g.vs[“color”] = [“red” if is_protein(vertex) else “blue” for vertex in g.vs]
plot(g)

The above assumes that proteins are those vertices whose name starts with “protein”.

— 
T.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]