GraphPlot¶
Draws a graph given as a list of edges.
A square matrix is taken directly as an adjacency matrix — symmetric matrices give undirected edges, anything else gives directed edges:
Method names the embedding to lay the vertices out with —
"CircularEmbedding" puts all of them on one circle, even when the graph
falls apart into separate pieces:
EdgeShapeFunction -> f draws each edge with f[{pt, …}, edge] instead
of the built-in arrow. The second argument is the edge itself, so a
DirectedEdge rather than a plain pair of vertices:
$ wo 'Head[GraphPlot[{1 -> 2, 2 -> 3}, EdgeShapeFunction -> ({Blue, Dashed, Line[#1]} &)]]'
Graphics
$ wo 'Head[GraphPlot[{1 -> 2, 2 -> 3}, EdgeShapeFunction -> (If[MemberQ[{DirectedEdge[1, 2]}, #2], {Blue, Arrow[#1]}, {LightGray, Line[#1]}] &)]]'
Graphics
EdgeShapeFunction -> None leaves the edges undrawn, a shape name says
how to draw them without a function, and the rule form gives single edges
a shape of their own:
$ wo 'Head[GraphPlot[{1 -> 2, 2 -> 3}, EdgeShapeFunction -> {DirectedEdge[1, 2] -> ({Red, Line[#1]} &)}]]'
Graphics
VertexRenderingFunction -> f draws each vertex with f[{x, y}, name]
instead of the built-in disk. The first argument is the vertex's
coordinate, the second its name:
VertexRenderingFunction -> None leaves the vertices undrawn: