GraphPlot

GraphPlot[g]

generates a plot of the graph g.

GraphPlot[{e1,e2,}]

generates a plot of the graph with edges ei.

GraphPlot[{,w[ei],}]

plots ei with features defined by the symbolic wrapper w.

GraphPlot[{vi 1vj 1,}]

uses rules vikvjk to specify the graph g.

GraphPlot[m]

uses the adjacency matrix m to specify the graph g.

Details and Options

  • GraphPlot attempts to place vertices to give a well laid-out version of the graph.
  • GraphPlot supports the same vertices and edges 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
  • GraphPlot has the same options as Graphics, with the following additions and changes:
  • DataRangeAutomaticthe range of vertex coordinates to generate
    DirectedEdgesFalsewhether to interpret Rule as DirectedEdge
    EdgeLabelsNonelabels and placements for edges
    EdgeLabelStyleAutomaticstyle to use for edge labels
    EdgeShapeFunctionAutomaticgenerate graphic shapes for edges
    EdgeStyleAutomaticstyles for edges
    GraphLayoutAutomatichow to lay out vertices and edges
    GraphHighlight{}vertices and edges to highlight
    GraphHighlightStyleAutomaticstyle for highlight
    MethodAutomaticmethod to use
    PerformanceGoal$PerformanceGoalaspects of performance to try to optimize
    PlotStyleAutomaticgraphics directives to determine styles
    PlotTheme$PlotThemeoverall theme for the graph
    VertexCoordinatesAutomaticcoordinates for vertices
    VertexLabelsAutomaticlabels and placements for vertices
    VertexLabelStyleAutomaticstyle to use for vertex labels
    VertexShapeAutomaticgraphic shape for vertices
    VertexShapeFunctionAutomaticgenerate graphic shapes for vertices
    VertexSizeMediumsize 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:
  • "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 all close all

Basic Examples  (3)

Plot a graph:

In[1]:=
Click for copyable input
Out[1]=

Plot a graph specified by edge rules:

In[1]:=
Click for copyable input
Out[1]=

Plot a graph specified by its adjacency matrix:

In[1]:=
Click for copyable input
Out[1]=

Scope  (11)

Options  (71)

Applications  (27)

Properties & Relations  (6)

Introduced in 2007
(6.0)
|
Updated in 2019
(12.0)