LayeredGraphPlot
LayeredGraphPlot [g]
generates a layered plot of the graph g.
LayeredGraphPlot [{e1,e2,…}]
generates a layered plot of the graph with edges ej.
LayeredGraphPlot [{…,w[ei],…}]
plots ei with features defined by the symbolic wrapper w.
LayeredGraphPlot [{vi1vj1,…}]
uses rules vikvjk to specify the graph g.
LayeredGraphPlot [m]
uses the adjacency matrix m to specify the graph g.
LayeredGraphPlot […,vpos]
places the dominant vertex v in the plot at position pos.
Details and Options
- LayeredGraphPlot attempts to place vertices in a series of "layers".
- LayeredGraphPlot supports the same vertices and edges as Graph .
- The following special wrappers can be used for the edges ei:
- LayeredGraphPlot by default puts "dominant" vertices at the top, and puts vertices lower in the "hierarchy" progressively further down.
- LayeredGraphPlot [g,pos] places the dominant vertices at position pos.
- Possible positions pos are: Top , Bottom , Left , Right .
- By default, LayeredGraphPlot places each dominant vertex at the top.
- LayeredGraphPlot has the same options as Graphics , with the following additions and changes: [List of all options]
- Possible settings for PlotTheme include common base themes:
-
"Business" a bright, modern look appropriate for business presentations or infographics"Detailed" identify data by employing labels and tooltips"Marketing" elegant, eye-catching design suitable for marketing needs"Minimal" simple graph"Monochrome" single-color design"Scientific" candid design useful for analyzing detailed data with labels and tooltips"Web" clean, bold design suitable for a consumer website or blog"Classic" historical design of graph to remain compatible with existing uses
- Graph features themes affect plot of vertices and edges. Feature themes include:
-
"LargeGraph" large graph"ClassicLabeled" classic graph"IndexLabeled" index-labeled graph
-
ImageMargins 0. the margins to leave around the graphicPreserveImageOptions Automatic whether to preserve image options when displaying new versions of the same graphic
List of all options
Examples
open allclose allBasic Examples (5)
Plot a graph:
Plot a graph specified by edge rules:
Plot a graph specified by its adjacency matrix:
Drawing a graph with different orientation from the default:
Specify the root node:
Scope (9)
Graph Specification (4)
Specify a graph using a graph:
Specify a graph using a rule list:
Specify a graph using a dense adjacency matrix:
Specify a graph using a sparse adjacency matrix:
Graph Styling (5)
Give labels for some edges:
Give vertex labels:
Show edges as lines:
Plot a disconnected graph using different packing methods:
Draw with different orientations:
Options (6)
DataRange (1)
Specify the range of vertex coordinates:
DirectedEdges (2)
By default edges are shown as arrows:
Do not show the direction of edges:
PlotStyle (3)
Specify an overall style for the graph:
PlotStyle can be combined with VertexShapeFunction , which has higher priority:
PlotStyle can be combined with EdgeShapeFunction , which has higher priority:
Applications (5)
A food chain:
A chart showing the relationships between shapes:
A flow chart for a computer program:
A visual representation of a straight-line program, used for common subexpression elimination:
The relationships between early versions of the Unix operating system:
Properties & Relations (3)
TreePlot provides a layered layout ignoring the direction of edges:
Use GraphPlot or GraphPlot3D for general undirected graph drawing:
Use ArrayPlot or MatrixPlot to display matrices:
Possible Issues (1)
When vertex coordinates are specified, all edges are shown as straight lines:
If explicit vertex coordinates are not specified, curved edges will be used:
Neat Examples (1)
Plot isotope decay networks:
Uranium-235:
Polonium-189:
Plutonium-239:
See Also
Graph TreePlot GraphPlot GraphPlot3D CommunityGraphPlot GraphLayout GraphEmbedding LayeredGraphPlot3D
Function Repository: LayeredGraphPlot3D DistanceLayeredGraph
Related Guides
Text
Wolfram Research (2007), LayeredGraphPlot, Wolfram Language function, https://reference.wolfram.com/language/ref/LayeredGraphPlot.html (updated 2020).
CMS
Wolfram Language. 2007. "LayeredGraphPlot." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/LayeredGraphPlot.html.
APA
Wolfram Language. (2007). LayeredGraphPlot. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LayeredGraphPlot.html
BibTeX
@misc{reference.wolfram_2025_layeredgraphplot, author="Wolfram Research", title="{LayeredGraphPlot}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/LayeredGraphPlot.html}", note=[Accessed: 27-April-2025 ]}
BibLaTeX
@online{reference.wolfram_2025_layeredgraphplot, organization={Wolfram Research}, title={LayeredGraphPlot}, year={2020}, url={https://reference.wolfram.com/language/ref/LayeredGraphPlot.html}, note=[Accessed: 27-April-2025 ]}