MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: weighted graph, edges thickness

  • To: mathgroup at smc.vnet.net
  • Subject: [mg104999] Re: weighted graph, edges thickness
  • From: "Sjoerd C. de Vries" <sjoerd.c.devries at gmail.com>
  • Date: Tue, 17 Nov 2009 05:14:55 -0500 (EST)
  • References: <hd8rus$5ks$1@smc.vnet.net> <hdgps4$i1a$1@smc.vnet.net>

Just replace the radius of the cylinder with the (scaled) weight of
the graph like I did before with the thickness of the line:

m = {{0, 2, 0, 0}, {0, 0, 1, 0}, {1, 0, 0, 5}, {1, 0, 0, 0}};

GraphPlot3D[m,
 EdgeRenderingFunction -> (Cylinder[{#1},
     m[[#2[[1]], #2[[2]]]]/20] &)]

Cheers -- Sjoerd

On Nov 13, 1:09 pm, cherifrahal <cherif.ra... at gmail.com> wrote:
> Thank you very much, It works very well for 2 D graphs
> But if i have a 3D graph does it work ?
>
> An example of a 3D graph :
>
> GraphPlot3D[{1 -> 2, 1 -> 4, 1 -> 5, 2 -> 3, 2 -> 6, 3 -> 4, 3 -> 7,
>  4 -> 8, 5 -> 6, 5 -> 8, 6 -> 7, 7 -> 8, 5 -> 10, 6 -> 11, 10 -> 11,
>  10 -> 12, 11 -> 12, 12 -> 13, 9 -> 13},
>  EdgeRenderingFunction -> (Cylinder[{#1}, 0.15] &),
>  VertexCoordinateRules -> {1 -> {-1, 1, 2}, 2 -> {1, 1, 2},
>   4 -> {-1, -1, 2}, 3 -> {1, -1, 2}, 5 -> {-2, 2, 0}, 6 -> {2, 2, 0},
>    7 -> {2, -2, 0}, 8 -> {-2, -2, 0}, 9 -> {0, 0, 2},
>   10 -> {-2, 4, 0}, 11 -> {2, 4, 0}, 12 -> {0, 3, 3},
>   13 -> {0, 2.2, 3.5}}]
>
> Cheers
>
> Cherif Rahal



  • Prev by Date: Re: NDSolve problem
  • Next by Date: Re: Fyi, Listing of Mathematica 7 functions (1869 functions)
  • Previous by thread: Re: weighted graph, edges thickness
  • Next by thread: Re: weighted graph, edges thickness