[sage-support] Re: getting the coordinates of the vertices of a drawn graph

2008-05-22 Thread Robert Bradshaw
On May 22, 2008, at 8:07 AM, Franco Saliola wrote: > > On Thu, May 22, 2008 at 10:50 AM, Robert Miller > <[EMAIL PROTECTED]> wrote: > >> sage: G = graphs.PetersenGraph() >> sage: sage.graphs.graph_fast.spring_layout_fast(G, iterations=50, >> dim=2) > > Perhaps this should be exposed as G.spring

[sage-support] Re: getting the coordinates of the vertices of a drawn graph

2008-05-22 Thread Franco Saliola
On Thu, May 22, 2008 at 10:50 AM, Robert Miller <[EMAIL PROTECTED]> wrote: > sage: G = graphs.PetersenGraph() > sage: sage.graphs.graph_fast.spring_layout_fast(G, iterations=50, > dim=2) Perhaps this should be exposed as G.spring_layout() (or some other name). It seems like it might be useful. C

[sage-support] Re: getting the coordinates of the vertices of a drawn graph

2008-05-22 Thread Nikos Apostolakis
Robert Miller <[EMAIL PROTECTED]> writes: > sage: G = graphs.PetersenGraph() > sage: sage.graphs.graph_fast.spring_layout_fast(G, iterations=50, > dim=2) [...] > sage: sage.graphs.graph_fast.spring_layout_fast(G, iterations=50, > dim=3) > That's exactly what I was looking for. This is great!

[sage-support] Re: getting the coordinates of the vertices of a drawn graph

2008-05-22 Thread Robert Miller
sage: G = graphs.PetersenGraph() sage: sage.graphs.graph_fast.spring_layout_fast(G, iterations=50, dim=2) {0: [0.93950023361313362, -0.088093655912920787], 1: [-0.032723044718243596, 0.0032620178712528453], 2: [-0.78167205667257567, 0.25668081056701608], 3: [-0.19695488333682584, 0.98041255292

[sage-support] Re: getting the coordinates of the vertices of a drawn graph

2008-05-22 Thread William Stein
On Thu, May 22, 2008 at 7:43 AM, Robert Miller <[EMAIL PROTECTED]> wrote: > > Nikos, > >> This seems to work only with graphs already known to Sage but not with >> new graphs constructed by the user. For example: > > If you construct a new graph, the position dictionary is not set. You > can do s

[sage-support] Re: getting the coordinates of the vertices of a drawn graph

2008-05-22 Thread Robert Miller
Nikos, > This seems to work only with graphs already known to Sage but not with > new graphs constructed by the user. For example: If you construct a new graph, the position dictionary is not set. You can do so with the set_pos() command, and if there is no position dict set when you plot, it u

[sage-support] Re: getting the coordinates of the vertices of a drawn graph

2008-05-22 Thread Nikos Apostolakis
Jason Grout <[EMAIL PROTECTED]> writes: > Nikos Apostolakis wrote: >> Hello, >> >> is there a way to get the the coordinates of the points where the >> vertices of a graph would be placed if drawn via plot2d or plot3d? > > > If the layout is already computed, the coordinates can be retrieved wit

[sage-support] Re: getting the coordinates of the vertices of a drawn graph

2008-05-21 Thread Jason Grout
Nikos Apostolakis wrote: > Hello, > > is there a way to get the the coordinates of the points where the > vertices of a graph would be placed if drawn via plot2d or plot3d? If the layout is already computed, the coordinates can be retrieved with get_pos() (and changed with set_pos()) sage: g=