Hi everyone,

I cannot find a simple way to plot a network with all nodes on a circle. So
I develop this method (which do the job):

def ring_layout(g,radius = 100):
  N = g.num_vertices()
  pos = g.new_vertex_property("vector<double>") 
  for v in g.vertices():
    i = g.vertex_index[v]
    posv = Vector_double()
    posv.append(radius*cos(2.*i*pi/N))
    posv.append(radius*sin(2.*i*pi/N))
    pos[v] = posv
  return pos

Is there a simpler way to do this in graph_tool? Is there something that I
am missing?

Thanks.

Best regards,
Julien



--
View this message in context: 
http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/Ring-layout-tp4025289.html
Sent from the Main discussion list for the graph-tool project mailing list 
archive at Nabble.com.
_______________________________________________
graph-tool mailing list
[email protected]
http://lists.skewed.de/mailman/listinfo/graph-tool

Reply via email to