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

MathGroup Archive 2008

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

Search the Archive

Re: changing style of vertices for ShowGraph with Combinatorica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg86339] Re: [mg86270] changing style of vertices for ShowGraph with Combinatorica
  • From: Murray Eisenberg <murray at math.umass.edu>
  • Date: Sun, 9 Mar 2008 04:59:26 -0500 (EST)
  • Organization: Mathematics & Statistics, Univ. of Mass./Amherst
  • References: <200803070729.CAA19892@smc.vnet.net> <C63D1D41-0058-431D-A84D-4418E66DBF46@lse.ac.uk>
  • Reply-to: murray at math.umass.edu

Another observation:  it's surprising that GraphPlot[Cycle[3],...] works 
at all!  The "More Information" on the reference page for GraphPlot does 
not say anything whatsoever to indicate that the argument to GraphPlot 
can be a Graph[...] object such as is provided by Combinatorica!



J. McKenzie Alexander wrote:
> Take a look at GraphPlot, the graph rendering function that is built 
> into the Mathematica kernel.  I switched from using ShowGraph to 
> GraphPlot after realising that it was (a) faster and (b) easier to 
> customise.  Here's what you want:
> 
> GraphPlot[
>  Cycle[3],
>  Method -> None,
>  EdgeRenderingFunction -> ({Black, Line[#1]} &),
>  VertexRenderingFunction -> ({EdgeForm[{Thickness[0.005], Red}], Yellow,
>      Disk[#1, 0.04]} &)
>  ]
> 
> You need to specify Method->None, otherwise GraphPlot will override the 
> specified positions of the vertices in the graph and use its own default 
> vertex positioning algorithm.
> 
> VertexRenderingFunction is what you need to define in order to customise 
> the appearance of the vertices.
> 
> I provided a definition of EdgeRenderingFunction just so that the edges 
> are rendered in the same way as ShowGraph.
> 
> Cheers,
> 
> Jason
> 
> -- 
> J. McKenzie Alexander
> Department of Philosophy, Logic and Scientific Method
> London School of Economics and Political Science
> Houghton Street, London WC2A 2AE
> 
> 
> On 7 Mar 2008, at 07:29, Murray Eisenberg wrote:
> 
>> With Mathematica 6, I can change the default style (medium black disk)
>> for rendering the vertices of a Combinatorica Graph like this:
>>
>>   Needs["Combinatorica`"]
>>
>>   g = Cycle[3];
>>   ShowGraph[g, VertexStyle -> Disk[Large], VertexColor -> Red]
>>
>> But how can I, for example, change the vertex style so it is, say, a
>> large yellow disk with a thick red boundary?  Or even just change it to
>> be a circle?  I tried "obvious" things like the following, but they
>> cause errors:
>>
>>   ShowGraph[g, VertexStyle -> Graphics[Circle[], ImageSize -> 20]]
>>
>> -- 
>> Murray Eisenberg                     murray at math.umass.edu
>> Mathematics & Statistics Dept.
>> Lederle Graduate Research Tower      phone 413 549-1020 (H)
>> University of Massachusetts                413 545-2859 (W)
>> 710 North Pleasant Street            fax   413 545-1801
>> Amherst, MA 01003-9305
>>
> 
> 
> 
> 
> 
> 
> Please access the attached hyperlink for an important electronic 
> communications disclaimer: 
> http://www.lse.ac.uk/collections/secretariat/legal/disclaimer.htm
> 

-- 
Murray Eisenberg                     murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305


  • Prev by Date: Re: Re: changing style of vertices for ShowGraph with Combinatorica
  • Next by Date: Re: Assignment problem
  • Previous by thread: Re: Re: Re: changing style of vertices for ShowGraph
  • Next by thread: Re: Re: changing style of vertices for ShowGraph with Combinatorica