generates a 3D plot of the graph g.

GraphPlot3D[{vi 1vj 1,vi 2vj 2,}]
generates a 3D plot of the graph in which vertex is connected to vertex .

GraphPlot3D[{{vi 1vj 1,lbl1},}]
associates labels with edges in the graph.

generates a plot of the graph represented by the adjacency matrix m.

Details and OptionsDetails and Options

  • GraphPlot3D attempts to place vertices in 3D to give a well laid-out version of the graph.
  • GraphPlot3D has the same options as Graphics3D, with the following additions and changes:
  • DataRangeAutomaticthe range of vertex coordinates to generate
    EdgeRenderingFunctionAutomaticfunction to give explicit graphics for edges
    MethodAutomaticthe method used to lay out the graph
    MultiedgeStyleAutomatichow to draw multiple edges between vertices
    PackingMethodAutomaticmethod to use for packing components
    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[vk,vlab] can be used to specify an alternative tooltip for a vertex.
  • With VertexRenderingFunction->f, each vertex is rendered with the 3D 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 3D 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.
  • The graphics primitives obtained by applying EdgeRenderingFunction and VertexRenderingFunction are in effect directly spliced into the 3D graphic generated by GraphPlot3D. Inset can be used to insert an arbitrary expression.
  • With the default setting DataRange->Automatic, coordinates are chosen so that the average length of the edges in the graph is approximately 1.
  • In VertexCoordinateRules, an explicit rule specifies coordinates for a vertex. If any coordinate is given as Automatic, it is found automatically. Vertices for which no rules are specified are taken to have automatically generated x, y, and z positions.
  • The graph does not need to be connected. Disconnected components are typically arranged so as to fill a planar 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.
  • The adjacency matrix m in GraphPlot3D[m] can be a SparseArray object.
  • With the default setting MultiedgeStyle->Automatic, multiple edges are not shown if the graph is specified by an adjacency matrix.
  • Possible settings for Method include , , , , , and .
  • With Method->Automatic, GraphPlot3D normally uses the method, though it uses the method if the graph is a tree.
  • GraphPlot3D returns a Graphics3D object.

ExamplesExamplesopen allclose all

Basic Examples  (4)Basic Examples  (4)

Draw a graph in 3D:

Click for copyable input

Display vertex labels:

Click for copyable input

Draw a graph specified by its adjacency matrix:

Click for copyable input

Use rendering and style options to tailor the presentation:

Click for copyable input
Introduced in 2007
| Updated in 2014
Translate this page: