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.
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 all close 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 (50)
AspectRatio (4)
By default, the ratio of the height to width for the plot is determined automatically:
Make the height the same as the width with AspectRatio 1:
Use numerical value to specify the height-to-width ratio:
AspectRatio Full adjusts the height and width to tightly fit inside other constructs:
Axes (3)
By default, Axes are not drawn for LayeredGraphPlot :
Use Axes True to turn on axes:
Turn each axis on individually:
AxesLabel (3)
No axes labels are drawn by default:
Place a label on the axis:
Specify axes labels:
AxesOrigin (2)
The position of the axes is determined automatically:
Specify an explicit origin for the axes:
AxesStyle (4)
Change the style for the axes:
Specify the style of each axis:
Use different styles for the ticks and the axes:
Use different styles for the labels and the axes:
DataRange (1)
Specify the range of vertex coordinates:
DirectedEdges (2)
By default edges are shown as arrows:
Do not show the direction of edges:
Frame (4)
LayeredGraphPlot does not use a frame by default:
Use Frame True to draw a frame around the plot:
Draw a frame on the left and right edges:
Draw a frame on the left and bottom edges:
FrameLabel (4)
Place a label along the bottom frame of a plot:
Frame labels are placed on the bottom and left frame edges by default:
Place labels on each of the edges in the frame:
Use a customized style for both labels and frame tick labels:
FrameStyle (2)
Specify the style of the frame:
Specify the style for each frame edge:
FrameTicks (8)
Frame ticks are not placed automatically by default:
Use a frame with ticks:
Use frame ticks on the bottom edge:
Use All to include tick labels on all edges:
Place tick marks at specific positions:
Draw frame tick marks at the specified positions with specific labels:
Specify the lengths for tick marks as a fraction of the graphics size:
Use different sizes in the positive and negative directions for each tick mark:
Specify a style for each frame tick:
FrameTicksStyle (3)
By default, the frame ticks and frame tick labels use the same styles as the frame:
Specify an overall style for the ticks, including the labels:
Use different style for the different frame edges:
ImageSize (7)
Use named sizes such as Tiny , Small , Medium and Large :
Specify the width of the plot:
Specify the height of the plot:
Allow the width and height to be up to a certain size:
Specify the width and height for a graphic, padding with space if necessary:
Setting AspectRatio Full will fill the available space:
Use maximum sizes for the width and height:
Use ImageSize Full to fill the available space in an object:
Specify the image size as a fraction of the available space:
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: 06-December-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: 06-December-2025]}