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

LayeredGraphPlot

LayeredGraphPlot
generates a layered plot of the graph in which vertex is connected to vertex .
LayeredGraphPlot
associates labels with edges in the graph.
LayeredGraphPlot
places the dominant vertices in the plot at position pos.
LayeredGraphPlot[m]
generates a layered plot of the graph represented by the adjacency matrix m.
  • LayeredGraphPlot attempts to draw the vertices of a graph in a series of "layers".
  • LayeredGraphPlot by default puts "dominant" vertices at the top, and puts vertices lower in the "hierarchy" progressively further down.
  • The vertex names and the labels can be any expressions.
DataRangeAutomaticthe range of vertex coordinates to generate
DirectedEdgesTruewhether to show edges as directed arrows
EdgeLabelingTruewhether to include labels given for edges
EdgeRenderingFunctionAutomaticfunction to give explicit graphics for edges
FrameFalsewhether to draw a frame around the plot
FrameTicksNonewhat ticks to include on the frame
MultiedgeStyleAutomatichow to draw multiple edges between vertices
PackingMethodAutomaticthe method to use for packing components
PlotRangePaddingAutomatichow much padding to include around the plot
PlotStyleAutomaticoverall graphics directives for vertices and edges
SelfLoopStyleAutomatichow to draw edges linking a vertex to itself
VertexCoordinateRulesAutomaticrules for explicit vertex coordinates
VertexLabelingAutomaticwhether to show vertex names as labels
VertexRenderingFunctionAutomaticfunction to give explicit graphics for vertices
  • With the default setting VertexLabeling->Automatic, vertices are displayed as points, with their names given in tooltips, so long as the number of vertices is not too large.
  • Tooltip can be used to specify an alternative tooltip for a vertex. Tooltip specifies a tooltip for an edge.
  • With VertexRenderingFunction->f, each vertex is rendered with the graphics primitives given by , where is the position where the vertex is being placed, and is its name.
  • With EdgeRenderingFunction->g, each edge is rendered with the graphics primitives given by , where , are the beginning and ending points of the edge, , are the beginning and ending vertices, and is any label specified for the edge.
  • In the graphics generated by LayeredGraphPlot, edges are effectively drawn first, and vertices afterwards.
  • The graph does not need to be connected. Disconnected components are typically arranged so as to fill area roughly uniformly.
  • When a graph is specified by an adjacency matrix, the names of its vertices are taken to be successive integers starting at 1.
  • With the default setting MultiedgeStyle->Automatic, multiple edges are not shown if the graph is specified by an adjacency matrix.
Draw a directed graph using a hierarchical layout:
Include vertex labels:
Show edge labels:
Draw a graph specified by its adjacency matrix:
Drawing a graph with different orientation from the default:
Draw a directed graph using a hierarchical layout:
In[1]:=
Click for copyable input
Out[1]=
 
Include vertex labels:
In[1]:=
Click for copyable input
Out[1]=
 
Show edge labels:
In[1]:=
Click for copyable input
Out[1]=
 
Draw a graph specified by its adjacency matrix:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
 
Drawing a graph with different orientation from the default:
In[1]:=
Click for copyable input
Out[1]=
Specify a graph using a rule list:
Specify a graph using a dense adjacency matrix:
Specify a graph using a sparse adjacency matrix:
Give labels for some edges:
Give vertex labels:
Do not show multiedges or self-loops:
Show edges as lines:
Plot a disconnected graph using different packing methods:
Draw with different orientations:
By default edges are shown as arrows:
Do not show the direction of edges:
By default edge labels are shown:
Display the edge label as a tooltip:
Display the edge label both explicitly and as a tooltip:
Change the setback used for arrows:
Draw self-loops as red arrows and other edges gray:
Use a custom arrowhead:
Draws vertices only:
Spread multiple edges by a specified scaled distance:
Pack disconnected components using different methods:
Use different PlotRangePadding around the graph:
Specify an overall style for the graph:
PlotStyle can be combined with VertexRenderingFunction, which has higher priority:
PlotStyle can be combined with EdgeRenderingFunction, which has higher priority:
Draw self-loops with a specified scaled diameter:
Show vertex labels:
Show vertex labels as tooltips:
Show vertex labels as tooltips only if the graph is small:
Show vertex labels both explicitly and as tooltips:
Explicitly specify all vertex coordinates:
Show no vertices:
Render vertices using a custom graphic:
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:
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:
When vertex coordinates are specified, all edges are shown as straight lines:
If explicit vertex coordinates are not specified, curved edges will be used:
Plot isotope decay networks:
Uranium-235:
Polonium-189:
Plutonium-239:
New in 6