| Author |
Comment/Response |
piggy
|
05/31/08 1:37pm
Hi,
I would like to use draw a graph with GraphPlot but the different edges have some attributes like color and thickness. So, I use edgerenderingfunction as follows. I provide an array of attributes in the same sequence of the edges I provide to graphplot. But the sequence of the edges seems to change when you plot and hence the attributes are getting mixed up. Let me know how to correct this.
Clear[getThickness];
Clear[getColor];
Clear[e];
Array[Freq, 3];
Freq[1] = 0.004; Freq[2] = 0.012; Freq[3] = 0.004; Array[Color, 3];
Color[1] = Red; Color[2] = Blue; Color[3] = Green;
count = 1;
getThickness[d_] := {getThickness[d] = Freq[count]; count++;}
ColorCount = 1;
getColor[d_] := {getColor[d] = Color[ColorCount]; ColorCount++;}
e = {LGA -> PHX, PHX -> LGA, LGA -> BOS};
g = GraphPlot[e, VertexLabeling -> True,
EdgeRenderingFunction -> ({getColor[#1],
Thickness[getThickness[#1]], Arrowheads[{{.05, .8}}],
Arrow[#1]} &)]
URL: , |
|