Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: GraphPlot questions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg97099] Re: GraphPlot questions
  • From: "Sjoerd C. de Vries" <sjoerd.c.devries at gmail.com>
  • Date: Thu, 5 Mar 2009 04:55:10 -0500 (EST)
  • References: <golr1r$qcl$1@smc.vnet.net>

Hi Robert,

The rendering function gets two parameters thrown at it, the name of
the vertex and its position. You can use the name as an index in an
array with pictures, (call it pics) and then:

GraphPlot[{1 -> 4, 1 -> 5, 2 -> 3, 2 -> 4, 2 -> 5, 3 -> 4, 3 -> 5},
 VertexRenderingFunction -> (Inset[pics[[#2]], #1] &)]

Cheers -- Sjoerd

On Mar 4, 2:09 pm, robert prince-wright <robertprincewri... at yahoo.com>
wrote:
> Does anyone know whether it is possible to have different Graphics object=
s as vertices for a GraphPlot? I would like to use Rectangle and Disk in th=
e same plot but can't figure out how to modify statements like the one belo=
w so that it allows me to do this:
>
> VertexRenderingFunction -> ({EdgeForm[Black], Yellow, Disk[#1, 0.05],
>     Black, Text[#2, #1]} &)
>
> It seems like VertexRenderingFunction is a one shot deal.
>
> Robert



  • Prev by Date: Re: question about mathlink.h
  • Next by Date: Re: Legends in GraphicsGrid
  • Previous by thread: GraphPlot questions
  • Next by thread: question about mathlink.h