This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

GraphCoordinates


calculates a visually appealing 2D layout of the vertices of the graph g and returns the coordinates of the vertices.
  • returns the coordinates of the vertices as computed using a graph drawing algorithm. This is useful when you need to draw a graph repeatedly using the same layout but different styles.
Needs["GraphUtilities`"]
  • This plots a graph:
In[2]:=
Click for copyable input
In[3]:=
Click for copyable input
Out[3]=
  • This gives the coordinates of the vertices in the previous drawing:
In[4]:=
Click for copyable input
Out[4]=
  • This plots the graph with two different styles, using the layout already calculated:
In[5]:=
Click for copyable input
Out[5]=
  • The relationship between vertices and coordinates is given by the following:
In[6]:=
Click for copyable input
Out[6]=
This shows a drawing of a small graph, and the coordinates associated with the drawing:
This shows the relationship between vertex labels and their coordinates:
The coordinates can be reused to create the drawing without recomputing:
This shows the LayeredGraphPlot of a directed graph:
only returns the position of the vertices:
The curved edges between vertices 1 and 3 are not reproduced:
This shows how to travel from vertex 1 to 7 through the shortest path: