[graph-tool] problem with draw.random_layout

tamo tamerih at gmail.com
Mon May 9 17:03:00 CEST 2011

it seems that I've a problem with graph_tool.draw.random_layout(g,
shape=None, pos=None, dim=2) function.
I wrote a script to load a graph from dot file then I was trying to assign a
random position for each vertex in the space.
I found that random_layout function could do that, but I doesn't work with

here is the code:

g = load_graph(infile+".dot")
pos = gt.graph_draw(g, output=None) # initial configuration
pos = gt.random_layout(g, shape=tuple, pos=pos, dim=2)

the error is: 

File "searchA.py", line 39, in <module>
    pos = gt.random_layout(g, shape=tuple, pos=pos, dim=2)
  File "/usr/local/lib/python2.6/dist-packages/graph_tool/draw/__init__.py",
line 531, in random_layout
    pos = ungroup_vector_property(pos)
TypeError: ungroup_vector_property() takes at least 2 arguments (1 given)

could you help me to solve this problem? 

I'd like to assign a random position to each vertex on my graph.
Thank you in advance :) 

View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/problem-with-draw-random-layout-tp2919028p2919028.html
Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.

More information about the graph-tool mailing list