workaround for GraphPlot not accepting node list?
- To: mathgroup at smc.vnet.net
- Subject: [mg121815] workaround for GraphPlot not accepting node list?
- From: Alan <alan.isaac at gmail.com>
- Date: Mon, 3 Oct 2011 04:23:55 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- Reply-to: comp.soft-sys.math.mathematica at googlegroups.com
The last line below produces a graph that does not show node c. How can I get node c to display when there are no edges to it? (Graph accepts a list of nodes, but how to do this with GraphPlot?)
Thanks,
Alan Isaac
abcGraphPlot[rules_] := GraphPlot[rules,
VertexLabeling -> True,
MultiedgeStyle -> False,
EdgeRenderingFunction -> ({Red, Arrowheads[0.05],
Arrow[#1, 0.15]} &),
DirectedEdges -> True,
SelfLoopStyle -> 0.3,
VertexCoordinateRules -> {a -> {1, Sqrt[3]}, b -> {0, 0},
c -> {2, 0}},
VertexRenderingFunction -> ({GrayLevel[0.9], EdgeForm[Black],
Disk[#, .15], Black, Text[#2, #1]} &),
ImagePadding -> 10,
ImageSize -> 200]
abcGraphPlot[{a -> a, a -> b, b -> a, c -> c}]
abcGraphPlot[{a -> a, a -> b, b -> a}] (* how to show node c? *)