[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [igraph] labelling vertices using python
From: |
venura.2.mendis |
Subject: |
RE: [igraph] labelling vertices using python |
Date: |
Tue, 15 Jul 2008 15:58:12 +0100 |
Excellent thanks Tamas. That has fixed the problem.
-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf
Of Tamas Nepusz
Sent: 15 July 2008 15:38
To: Help for igraph users
Subject: Re: [igraph] labelling vertices using python
Hi,
I checked your code and I think I found the error. When you create
your graph using igraph.Graph(), the created graph already contains a
vertex. When you add your vertices by g.add_vertices(...), there will
be an extra vertex without a label. Its "label" attribute will be
None, which is not a string -- that's why the call to
Context.text_extents() fails.
Note that you can supply the number of vertice directly to the
constructor:
g = igraph.Graph(len(nodeList), directed=False)
--
Tamas
On 2008.07.15., at 15:47, <address@hidden>
<address@hidden
> wrote:
> Hi Tamas, thanks for looking at this. Ive attached the files its about
> 28k. Not sure if the mailing list supports attachments but if it
> doesn't
> work, could you send me your email address for direct email?
>
> Thanks,
> Venura
>
> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden On
> Behalf
> Of Tamas Nepusz
> Sent: 15 July 2008 14:11
> To: Help for igraph users
> Subject: Re: [igraph] labelling vertices using python
>
>> create with this label. This all seems to be ok and when I plot the
>> graph without labels everything is fine (igraph.plot(g, "g.png",
>> vertex_label=None). However with labels I get the following errors,
> Very strange indeed. Can you please send me an example list from which
> you try to construct the graph? I would need a serialized (pickled)
> variant of your nodeList variable; you can save it in a file called
> pickled_nodelist.dat as follows:
>
> import pickle
> f = open("pickled_nodelist.dat", "w")
> pickle.dump(nodeList, f)
> f.close()
>
> Please send me the generated pickled_nodelist.dat and I'll try to dig
> deeper into this issue.
>
> --
> Tamas
>
>
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
> <pickled_nodelist.dat>_______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
_______________________________________________
igraph-help mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/igraph-help