Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #5151 > unrolled thread
| Started by | Alan <alan.isaac@gmail.com> |
|---|---|
| First post | 2011-09-22 11:30 +0000 |
| Last post | 2011-09-25 02:38 +0000 |
| Articles | 4 — 2 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
GraphPlot bug? (missing self-loop) Alan <alan.isaac@gmail.com> - 2011-09-22 11:30 +0000
Re: GraphPlot bug? (missing self-loop) Simon <simonjtyler@gmail.com> - 2011-09-23 07:47 +0000
Re: GraphPlot bug? (missing self-loop) Alan <alan.isaac@gmail.com> - 2011-09-25 02:34 +0000
Re: GraphPlot bug? (missing self-loop) Alan <alan.isaac@gmail.com> - 2011-09-25 02:38 +0000
| From | Alan <alan.isaac@gmail.com> |
|---|---|
| Date | 2011-09-22 11:30 +0000 |
| Subject | GraphPlot bug? (missing self-loop) |
| Message-ID | <j5f68l$q85$1@smc.vnet.net> |
How can I display self-loops using GraphPlot when the input is an adjacency matrix?
GraphPlot[{a -> a, a -> b}, DirectedEdges -> True] (* displays self-loop *)
GraphPlot[{{1, 1}, {0, 0}}, DirectedEdges -> True] (* missing self-loop *)
GraphPlot gives similarly surprising results when the input is a graph:
g = Graph[{a -> a, a -> b}, DirectedEdges -> True] (* displays self loop *)
GraphPlot[g, DirectedEdges -> True] (* missing self loop *)
Thanks,
Alan Isaac
[toc] | [next] | [standalone]
| From | Simon <simonjtyler@gmail.com> |
|---|---|
| Date | 2011-09-23 07:47 +0000 |
| Message-ID | <j5hdj8$7jl$1@smc.vnet.net> |
| In reply to | #5151 |
You need to set the option SelfLoopStyle -> True or a positive number.
[toc] | [prev] | [next] | [standalone]
| From | Alan <alan.isaac@gmail.com> |
|---|---|
| Date | 2011-09-25 02:34 +0000 |
| Message-ID | <j5m403$pj1$1@smc.vnet.net> |
| In reply to | #5160 |
On Friday, September 23, 2011 3:47:52 AM UTC-4, Simon wrote: > You need to set the option SelfLoopStyle -> True or a positive number. And here I thought I did RTFM. Sorry to have missed that; thank you for this help. (I still find odd the different default behavior and the different option sets of Graph and GraphPlot.) Thanks! Alan
[toc] | [prev] | [next] | [standalone]
| From | Alan <alan.isaac@gmail.com> |
|---|---|
| Date | 2011-09-25 02:38 +0000 |
| Message-ID | <j5m47p$plt$1@smc.vnet.net> |
| In reply to | #5160 |
Follow up question. The code below almost works how I want, but the last line produces a graph that does not show node c. How can I get node c to display when there are no edges to it? (I know I can do this with Graph by providing a list of nodes, but how to do it 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}]
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web