Date: Mon, 6 Oct 2014 00:38:29 +0200
From: tiago@skewed.de
To: graph-tool@skewed.de
Subject: Re: [graph-tool] Fixing position of root vertex
On 05.10.2014 06:42, luistavares wrote:
> Hi,
>
> I'm using the code below to fix the position of a root vertex. I'm
> developing an application and I wanna make sure that the root vertex is
> always located in the same place.
>
> g = Graph()
> v_pin = g.new_vertex_property("bool")
> v = g.add_vertex()
> v_pin[v] = True #root vertex
> ...
> pos = sfdp_layout(g, pin=v_pin)
> graph_draw(g, ...)
>
> I suppose it's working, but how I can confirm which one is the root vertex
> in my result?
There are many ways: You can change the shape, size, and color of the
vertices to your liking. It is all described in the documentation.
For instance, to change the color of the root you would do:
c = g.new_vertex_property("int")
c[root] = 1
graph_draw(g, vertex_fill_color=c)
Best,
Tiago
--
Tiago de Paula Peixoto <tiago@skewed.de>
_______________________________________________
graph-tool mailing list
graph-tool@skewed.de
http://lists.skewed.de/mailman/listinfo/graph-tool