On Mon, Nov 17, 2014 at 11:49 AM, Tiago de Paula Peixoto <[email protected]> wrote: > On 17.11.2014 11:56, Leonardo Chiquitto wrote: >> While pinning the vertices' positions is trivial, I couldn't find a >> nice solution to "pin the colors": every time a new color is used, >> the normalization process picks new colors for all vertices, >> giving the false impression that the algorithm has changed them. > > The colors do not have to be simple scalar values, they can also be > strings such as "green" or "#00FF00" or RGBA vectors such as [0., 1., > 0., 1.]. That means you can set the color by hand, and avoid the > normalization. For example: > > color = g.new_vertex_property("vector<double>") > color[g.vertex(0)] = [.1, .9, .1, 1.] > color[g.vertex(1)] = [.9, .0, .1, 1.] > ... > graph_draw(g, vertex_fill_color=color)
Thanks! This is exactly what I was looking for. Leonardo _______________________________________________ graph-tool mailing list [email protected] http://lists.skewed.de/mailman/listinfo/graph-tool
