Take for instance the simple graph
Graph[{1, 2, 3}, {1 <-> 3, 2 <-> 3},
VertexCoordinates -> {{0, 0}, {1, 0}, {2, 0}},
VertexLabels -> Automatic]
and note that the edges 1<->3
and 2<->3
overlap visually. Is there a way to keep the manual vertex positioning and have the edges reroute intelligently?
Another, more interesting, example where overlapping edges really start to become a problem:
g = Graph[Range[9],
EdgeList@AdjacencyGraph[
ConstantArray[1, {9, 9}] - IdentityMatrix[9]],
VertexCoordinates -> Flatten[Table[{i, j}, {i, 1, 3}, {j, 1, 3}], 1],
VertexLabels -> Automatic]
For GraphPlot
there is an option MultiedgeStyle
that controls spacing between edges.
GraphPlot[g, MultiedgeStyle -> #] & /@ {0.1, 0.2, 0.5, 1}
Especially for stuff like HighlightGraph
and EdgeStyle
to selectively stylize edges I'd rather keep using Graph
instead of GraphPlot
and friends. See this Q&A for more details about the differences between the two.