MathGroup Archive 2008

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

Search the Archive

Re: Re: EdgeRenderingFunction to produce edge labels in

P_ter wrote:

>Carl Woll writes:
>Thread[Range[Length[vertices]] -> (VertexLabel /.
>vertices[[All,2 ;;]])],
>_ -> VertexLabel
>I am just curious. Why the DeleteCases? In this simple example DeleteCases does nothing. In what kind of graph would it have a function?
>with friendly greetings,
I wanted my code to handle the case where some or all vertex labels are 
unspecified. For example, without the DeleteCases you would obtain the 
following for Cycle[3]:


Graph[{{{1, 2}}, {{2, 3}}, {{1, 3}}},
   {{{-0.4999999999999998, 0.8660254037844387}},
     {{-0.5000000000000004, -0.8660254037844384}}, {{1., 0}}}]

vertices = g[[2]];

Thread[Range[Length[vertices]] -> (VertexLabel /. vertices[[All, 2;;]])]


Obviously, I don't want to perform these replacement rules on the list 
of vertices.

Carl Woll
Wolfram Research

  • Prev by Date: Re: Any One have an idea?
  • Next by Date: Re: Dynamic (more)
  • Previous by thread: Re: EdgeRenderingFunction to produce edge labels in GraphPlot
  • Next by thread: Manipulate on the web