gives coordinates of the vertices of the graph g.
GraphEmbedding[g,"emb"]
gives coordinates of the vertices of the graph g using the embedding "emb".
GraphEmbedding[g,"emb",dim]
gives coordinates in dimension dim of the vertices of the graph g using the embedding "emb".
GraphEmbedding
gives coordinates of the vertices of the graph g.
GraphEmbedding[g,"emb"]
gives coordinates of the vertices of the graph g using the embedding "emb".
GraphEmbedding[g,"emb",dim]
gives coordinates in dimension dim of the vertices of the graph g using the embedding "emb".
Details
- The settings for the embedding "emb" are the same as in GraphLayout.
Examples
open all close allBasic Examples (2)
Get the coordinates of the vertices of a graph:
g = GraphData["IcosahedralGraph"]GraphEmbedding[g]Obtain coordinates in two dimensions and three dimensions for spring embedding:
g = RandomGraph[{5, 7}];GraphEmbedding[g, "SpringEmbedding"]GraphEmbedding[g, "SpringEmbedding", 3]Scope (23)
GraphEmbedding works with undirected graphs:
GraphEmbedding[[image]]GraphEmbedding[[image]]GraphEmbedding[[image]]GraphEmbedding[[image]]Get the coordinates of vertices using the "BalloonEmbedding":
GraphEmbedding[[image], "BalloonEmbedding"]GraphEmbedding[[image], "BipartiteEmbedding"]GraphEmbedding[[image], "CircularEmbedding"]"CircularMultipartiteEmbedding":
GraphEmbedding[[image], "CircularMultipartiteEmbedding"]GraphEmbedding[[image], "DiscreteSpiralEmbedding"]GraphEmbedding[[image], "GridEmbedding"]GraphEmbedding[[image], "HighDimensionalEmbedding"]GraphEmbedding[[image], "LayeredEmbedding"]GraphEmbedding[[image], "LinearEmbedding"]GraphEmbedding[[image], "MultipartiteEmbedding"]GraphEmbedding[[image], "PlanarEmbedding"]GraphEmbedding[[image], "RadialEmbedding"]GraphEmbedding[[image], "RandomEmbedding"]GraphEmbedding[[image], "SpectralEmbedding"]GraphEmbedding[[image], "SpiralEmbedding"]GraphEmbedding[[image], "SpringElectricalEmbedding"]GraphEmbedding[[image], "SpringEmbedding"]GraphEmbedding[[image], "StarEmbedding"]Get the coordinates of vertices in higher dimensions:
GraphEmbedding[[image], "SpringEmbedding", 3]Applications (3)
Visualize isomorphisms between two graphs:
{g1, g2} = {[image], [image]};IsomorphicGraphQ[g1, g2]map = FindGraphIsomorphism[g1, g2];Reorder coordinates based on the isomorphism:
order = VertexIndex[g2, #]& /@ (VertexList[g1] /. First[map]);
vstart = GraphEmbedding[g1];
vend = GraphEmbedding[g2][[order]];Show a transformation of one graph to another one:
linear[x_, y_, t_] := (1 - t) x + t y;Table[Graph[VertexList[g1], EdgeList[g1], VertexCoordinates -> linear[vstart, vend, t], Options[g1]],
{t, 0, 1, 1 / 7}]Generate a 3D plot of a graph:
g = RandomGraph[{10, 30}]coords = GraphEmbedding[g, "SpringElectricalEmbedding", 3];Plot the graph using graphics primitives:
Graphics3D[GraphicsComplex[coords, {Table[Sphere[VertexIndex[g, v], .1], {v, VertexList[g]}], Table[Tube[{VertexIndex[g, First[e]], VertexIndex[g, Last[e]]}, .03], {e, EdgeList[g]}]}], Boxed -> False]Highlight cliques and subgraphs:
g = ExampleData[{"NetworkGraph", "FamilyGathering"}];clique = First[FindClique[g]]Modify coordinates of the clique:
coords = GraphEmbedding[g];Do[coords[[VertexIndex[g, i]]] += {-.1, .6}, {i, clique}];Show the graph and the highlighted clique:
Row[{g, HighlightGraph[g, Subgraph[g, clique], VertexCoordinates -> coords, ImagePadding -> 5]}, " ⟹ "]Properties & Relations (2)
Obtain vertex placement of graph layout:
g = RandomGraph[{10, 20}]coords = GraphEmbedding[g]Plot the graph using graphics primitives:
Graphics[GraphicsComplex[coords, {Table[Point[VertexIndex[g, v]], {v, VertexList[g]}], Table[Line[{VertexIndex[g, First[e]], VertexIndex[g, Last[e]]}], {e, EdgeList[g]}]}]]Use the option VertexCoordinates to get vertex coordinates:
g = GraphData["IcosahedralGraph"]VertexCoordinates /. Options[g, VertexCoordinates]GraphEmbedding[g]See Also
VertexCoordinates GraphLayout LayeredGraphPlot TreePlot GraphPlot GraphPlot3D CommunityGraphPlot LayeredGraphPlot3D
Function Repository: VertexCoordinateList
Related Guides
History
Text
Wolfram Research (2012), GraphEmbedding, Wolfram Language function, https://reference.wolfram.com/language/ref/GraphEmbedding.html.
CMS
Wolfram Language. 2012. "GraphEmbedding." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/GraphEmbedding.html.
APA
Wolfram Language. (2012). GraphEmbedding. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GraphEmbedding.html
BibTeX
@misc{reference.wolfram_2026_graphembedding, author="Wolfram Research", title="{GraphEmbedding}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/GraphEmbedding.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_graphembedding, organization={Wolfram Research}, title={GraphEmbedding}, year={2012}, url={https://reference.wolfram.com/language/ref/GraphEmbedding.html}, note=[Accessed: 13-June-2026]}