[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] adding attribute to an edge, depending on nodes
From: |
Marco |
Subject: |
Re: [igraph] adding attribute to an edge, depending on nodes |
Date: |
Fri, 7 Nov 2008 15:53:31 +0100 |
Hi Tamas,
i was almost there! I was tryin to use g.es as a list, which was
obviously the wrong idea.
g.es[g.ecount()-1]['color']='red'
if the attr works as in the vertices, it should be painted red when i
plot the graph but... I don't see it red :(
Thanks!!
marco
--
è il gioco della vita,
la dobbiamo preparare
che non ci sfugga dalle dita
come la sabbia in riva al mare.
Lucio Dalla
On Fri, Nov 7, 2008 at 3:42 PM, Tamas Nepusz <address@hidden> wrote:
>> AFAIK is not possibile, when creating the edge, to set some attribute
>> for the edge.
>> How can i set attribute to that edge, without revisiting the graph?
> Hmmm, good point, we should have an attrs= keyword argument for
> add_edges and add_vertices. In the meanwhile, you can (ab)use the fact
> that the most recently added edge always has the highest ID:
>
> g.add_edges([(1,2)])
> g.es[g.ecount()-1]["label"] = "123"
>
> --
> Tamas
>
>
>
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
>
- [igraph] adding attribute to an edge, depending on nodes, Marco, 2008/11/07
- Re: [igraph] adding attribute to an edge, depending on nodes, Tamas Nepusz, 2008/11/07
- Re: [igraph] adding attribute to an edge, depending on nodes,
Marco <=
- Re: [igraph] adding attribute to an edge, depending on nodes, Tamas Nepusz, 2008/11/07
- Re: [igraph] adding attribute to an edge, depending on nodes, Marco, 2008/11/07
- Re: [igraph] adding attribute to an edge, depending on nodes, Tamas Nepusz, 2008/11/07
- Re: [igraph] adding attribute to an edge, depending on nodes, Marco, 2008/11/07
- [igraph] subgraph from edge seq, Sergio Jiménez, 2008/11/10
- Re: [igraph] subgraph from edge seq, Tamas Nepusz, 2008/11/10
- RE: [igraph] subgraph from edge seq, Sergio Jiménez, 2008/11/10
Re: [igraph] adding attribute to an edge, depending on nodes, Neal Becker, 2008/11/07