[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] Assigning different colours to different links/edges in Pyt
From: |
Tamás Nepusz |
Subject: |
Re: [igraph] Assigning different colours to different links/edges in Python |
Date: |
Mon, 18 Apr 2011 20:14:06 +0200 |
Hi,
You can change the colors of the edges by assigning a value to the "color"
attribute of the edges. E.g.:
# Make all the edges black
g.es["color"] = "black"
# Make the color of edge with ID=1 red
g.es[1]["color"] = "red"
Alternatively, you can construct a colors list in advance where element i
specifies the color of edge i, and then assign this list to g.es["color"]
colors = ["red", "green", "black", ...]
g.es["color"] = colors
Of course you'll also have to find 50 different colors if you want to show 50
edge communities. The list of known color names is to be found in the
"known_colors" dictionary:
from igraph import known_colors
print known_colors.keys()
You can also specify other colors using standard HTML notation; for instance,
"#ff8800".
--
T.
On 18 Apr 2011, at 20:09, Shafique, M. (UNU-MERIT) wrote:
> Hi. I need to draw a network which is the output of link clustering algorithm
> of Ahn et al (nature, 2010). It involves about 50 communities of more than
> 30000 edges. I'm wondering if it is possible in igraph to assign different
> colours to different link communities, and if so, how?
>
> Regards,
> Muhammad
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help