Given a Graph
with an automatically computed layout (i.e. not explicitly given VertexCoordinates
, but using a GraphLayout
method), how can we extract the coordinates of the vertices?
In[]:= g = RandomGraph[{10, 20}, GraphLayout -> "SpringEmbedding"]
Out[]= << picture of graph >>
In[]:= PropertyValue[g, VertexCoordinates]
Out[]= Automatic (* <-- I'd like to have a list of coordinates here *)
It's possible to convert the graph into a graphics object using Show
and extract the coordinates from there. Is there a less hacky, more direct/robust way?