GraphPlot3D

GraphPlot3D[g]

generates a 3D plot of the graph g.

GraphPlot3D[{e1,e2,}]

generates a 3D plot of the graph with edges ei.

GraphPlot3D[{,w[ei],}]

plots ei with features defined by the symbolic wrapper w.

GraphPlot3D[{vi 1vj 1,}]

uses rules vikvjk to specify the graph g.

GraphPlot3D[m]

uses the adjacency matrix m to specify the graph g.

Details and Options

  • GraphPlot3D attempts to place vertices in 3D to give a well-laid-out version of the graph.
  • GraphPlot3D supports the same vertices, edges and wrappers as Graph.
  • The following special wrappers can be used for the edges ei:
  • Annotation[ei,label]provide an annotation
    Button[ei,action]define an action to execute when the element is clicked
    EventHandler[ei,]define a general event handler for the element
    Hyperlink[ei,uri]make the element act as a hyperlink
    Labeled[ei,]display the element with labeling
    PopupWindow[ei,cont]attach a popup window to the element
    StatusArea[ei,label]display in the status area when the element is moused over
    Style[ei,opts]show the element using the specified styles
    Tooltip[ei,label]attach an arbitrary tooltip to the element
  • GraphPlot3D has the same options as Graphics3D, with the following additions and changes:
  • DataRange Automaticthe range of vertex coordinates to generate
    DirectedEdges Falsewhether to interpret Rule as DirectedEdge
    EdgeLabelsNonelabels and placements for edges
    EdgeLabelStyleAutomaticstyle to use for edge labels
    EdgeShapeFunctionAutomaticgenerate graphic shapes for edges
    EdgeStyleAutomaticstyles for edges
    GraphLayout Automatichow to lay out vertices and edges
    GraphHighlight{}vertices and edges to highlight
    GraphHighlightStyleAutomaticstyle for highlight
    MethodAutomaticmethod to use
    PerformanceGoalAutomaticaspects of performance to try to optimize
    PlotStyle Automaticgraphics directives to determine styles
    PlotThemeAutomaticoverall theme for the graph
    VertexCoordinatesAutomaticcoordinates for vertices
    VertexLabelsNonelabels and placements for vertices
    VertexLabelStyleAutomaticstyle to use for vertex labels
    VertexShapeAutomaticgraphic shape for vertices
    VertexShapeFunctionAutomaticgenerate graphic shapes for vertices
    VertexSizeAutomaticsize of vertices
    VertexStyleAutomaticstyles for vertices
  • With the setting VertexCoordinates->Automatic, the embedding of vertices and routing of edges is computed automatically, based on the setting for GraphLayout.
  • Possible special embeddings for GraphLayout include:
  • "BipartiteEmbedding"vertices on two parallel lines
    "CircularEmbedding"vertices on a circle
    "CircularMultipartiteEmbedding"vertices on segments of a circle
    "DiscreteSpiralEmbedding"vertices on a discrete spiral
    "GridEmbedding"vertices on a grid
    "LinearEmbedding"vertices on a line
    "MultipartiteEmbedding"vertices on several parallel lines
    "SpiralEmbedding"vertices on a 3D spiral projected to 2D
    "StarEmbedding"vertices on a circle with a center
  • Possible structured embeddings for layered graphs such as trees and directed acyclic graphs include:
  • "BalloonEmbedding"vertices on a circle with the center at the parent vertex
    "RadialEmbedding"vertices on a circular segment
    "LayeredDigraphEmbedding"vertices on parallel lines for directed acyclic graphs
    "LayeredEmbedding"vertices on parallel lines
  • Possible optimizing embeddings all minimize a quantity and include:
  • "HighDimensionalEmbedding"energy for spring-electrical in high dimension
    "PlanarEmbedding"number of edge crossings
    "SpectralEmbedding"weighted sum of squares distances
    "SpringElectricalEmbedding"energy with edges as springs and vertices as charges
    "SpringEmbedding"energy with edges as springs
    "TutteEmbedding"number of edge crossings and distance to neighbors
  • Possible settings for PlotTheme include common base themes, color feature themes, font features themes, and size features 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

Examples

open allclose all

Basic Examples  (3)

Plot a graph in 3D:

Plot a graph specified by edge rules:

Plot a graph specified by its adjacency matrix:

Scope  (12)

Graph Specification  (6)

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:

Use GraphData for collections of graphs:

Use ExampleData for collections of sparse matrices:

Graph Styling  (6)

Give labels for some edges:

Give vertex labels:

Show edges as arrows:

Plot a disconnected graph using different packing methods:

For very large graphs, it is often better not to draw vertices at all:

Use EdgeShapeFunction and VertexShapeFunction for detailed control:

Options  (71)

DataRange  (1)

Specify the range of vertex coordinates:

DirectedEdges  (1)

Show the direction of edges:

GraphLayout  (66)

"BalloonEmbedding"  (6)

Place each vertex in an enclosing circle centered at its parent vertex:

"BalloonEmbedding" works best for tree graphs:

Use the option "EvenAngle"->True to place vertices evenly in an enclosing circle:

With the setting "OptimalOrder"->True, the vertex ordering optimizes the angular resolution and the aspect ratio:

Use the option "RootVertex"->v to set the root vertex:

Use "SectorAngles"->s to control the size of each sector:

"BipartiteEmbedding"  (1)

Place vertices on two vertical lines based on a bipartite partition:

"CircularEmbedding"  (2)

Place vertices on a circle:

Use the option "Offset"->offset to specify the offset angles:

"CircularMultipartiteEmbedding"  (2)

Place vertices on polygon lines based on a vertex partition:

Use "VertexPartition"->partition to specify a partition of vertices:

"DiscreteSpiralEmbedding"  (3)

Place vertices on a discrete spiral:

"DiscreteSpiralEmbedding" works best for path graphs:

With the setting "OptimalOrder"True, vertices are reordered so that they lie nicely on a discrete spiral:

"GridEmbedding"  (2)

Place vertices on a grid:

Use "Dimension"->dim to specify a dimension of a grid:

"HighDimensionalEmbedding"  (2)

Place vertices in high dimension according to spring-electrical embedding and project down:

Use "RandomSeed"->int to specify a seed for the random number generator that computes the initial vertex placement:

"LayeredEmbedding"  (6)

Place vertices in several layers in such a way as to minimize edges between nonadjacent layers:

"LayeredEmbedding" works best for tree graphs:

Use the option "LayerSizeFunction"->func to specify the relative height:

Use the option "RootVertex"->v to set the root vertex:

Use the option "LeafDistance"->d to specify the leaf distance:

Use the option "Orientation"->o to draw a tree with different orientations:

"LayeredDigraphEmbedding"  (3)

Place vertices in a series of layers:

Use the option "RootVertex"->v to set the root vertex:

Use the option "Orientation"->o to draw a tree with different orientations:

"LinearEmbedding"  (2)

Place vertices on a line:

Use the option "Method"->m to specify the algorithm:

"MultipartiteEmbedding"  (2)

Place vertices on multiple line grids based on a vertex partition:

Use "VertexPartition"->partition to specify a partition of vertices:

"PlanarEmbedding"  (1)

Place vertices on a plane without an edge crossing:

"RadialEmbedding"  (2)

Place vertices in concentric circles:

Use the option "RootVertex"->v to set the root vertex:

"RandomEmbedding"  (1)

Place vertices randomly:

"SpectralEmbedding"  (2)

Place vertices so the weighted sum of squares of mutual distances is minimized:

Use the option "RelaxationFactor"->r to get the layout based on a relaxed Laplace matrix.

"SpiralEmbedding"  (2)

Place vertices on a spiral:

With the setting "OptimalOrder"->True, vertices are reordered so that they lie on the spiral nicely:

"SpringElectricalEmbedding"  (12)

Place vertices so that they minimize mechanical and electrical energy when each vertex has a charge and each edge corresponds to a spring:

With the setting "EdgeWeighted"->True, edge weights are used:

Use the option "EnergyControl"->e to specify limitations on the total energy of the system during minimization:

Use "InferentialDistance"->d to specify a cutoff distance beyond which the interaction between vertices is assumed to be nonexistent:

Use "MaxIteration"->it to specify a maximum number of iterations to be used in attempting to minimize the energy:

Use "Multilevel"->method to specify a method used during a recursive procedure of coarsening a graph:

With the setting "Octree"->True, an octree data structure (in three dimensions) or a quadtree data structure (in two dimensions) is used in the calculation of repulsive force:

Use "RandomSeed"->int to specify a seed for the random number generator that computes the initial vertex placement:

Use "RepulsiveForcePower"->r to control how fast the repulsive force decays over distance:

Use "StepControl"->method to define how step length is modified during energy minimization:

Use "StepLength"->r to specify the initial step length used in moving the vertices around:

Use "Tolerance"->r to specify the tolerance used in terminating the energy minimization process:

"SpringEmbedding"  (10)

Place vertices so that they minimize mechanical energy when each edge corresponds to a spring:

With the setting "EdgeWeighted"->True, edge weights are used:

Use the option "EnergyControl"->e to specify limitations on the total energy of the system during minimization:

Use "InferentialDistance"->d to specify a cutoff distance beyond which the interaction between vertices is assumed to be nonexistent:

Use "MaxIteration"->it to specify a maximum number of iterations to be used in attempting to minimize the energy:

Use "Multilevel"->method to specify a method used during a recursive procedure of coarsening a graph:

Use "RandomSeed"->int to specify a seed for the random number generator that computes the initial vertex placement:

Use "StepControl"->method to define how step length is modified during energy minimization:

Use "StepLength"->r to specify the initial step length used in moving the vertices around:

Use "Tolerance"->r to specify the tolerance used in terminating the energy minimization process:

"StarEmbedding"  (3)

Place vertices on a star shape:

Use the option "Offset"->offset to specify the offset angles:

Use the option "Center"->center to specify the center:

"TutteEmbedding"  (2)

Place vertices without crossing edges and minimize the sum of distances to neighbors:

"TutteEmbedding" works for 3-connected planar graphs only:

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  (2)

Make a 3D graph layout with spheres and cylinders:

Structure an engineering matrix:

Properties & Relations  (7)

Use LayeredGraphPlot for hierarchical-style drawing of directed graphs:

Use TreePlot for different types of tree drawing:

Use GraphPlot to draw graphs in 2D:

Use GraphData for an extensive collection of predefined graphs and properties:

Get the connectivity and plot it:

Use PolyhedronData for a large collection of polyhedra and properties:

Compare to a predefined embedding:

Use ExampleData for a large collection of sparse matrices:

Use ArrayPlot or MatrixPlot to display sparse matrices:

Wolfram Research (2007), GraphPlot3D, Wolfram Language function, https://reference.wolfram.com/language/ref/GraphPlot3D.html (updated 2019).

Text

Wolfram Research (2007), GraphPlot3D, Wolfram Language function, https://reference.wolfram.com/language/ref/GraphPlot3D.html (updated 2019).

CMS

Wolfram Language. 2007. "GraphPlot3D." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2019. https://reference.wolfram.com/language/ref/GraphPlot3D.html.

APA

Wolfram Language. (2007). GraphPlot3D. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GraphPlot3D.html

BibTeX

@misc{reference.wolfram_2022_graphplot3d, author="Wolfram Research", title="{GraphPlot3D}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/GraphPlot3D.html}", note=[Accessed: 29-May-2023 ]}

BibLaTeX

@online{reference.wolfram_2022_graphplot3d, organization={Wolfram Research}, title={GraphPlot3D}, year={2019}, url={https://reference.wolfram.com/language/ref/GraphPlot3D.html}, note=[Accessed: 29-May-2023 ]}