MathGroup Archive 2008

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

Search the Archive

Re: Vertex Colors

  • To: mathgroup at smc.vnet.net
  • Subject: [mg94004] Re: [mg93984] Vertex Colors
  • From: Murray Eisenberg <murray at math.umass.edu>
  • Date: Tue, 2 Dec 2008 00:39:00 -0500 (EST)
  • Organization: Mathematics & Statistics, Univ. of Mass./Amherst
  • References: <200812011159.GAA05782@smc.vnet.net>
  • Reply-to: murray at math.umass.edu

    mat = Partition[{0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0}, 4];
    Needs["Combinatorica`"]
    ShowLabeledGraph[FromAdjacencyMatrix[mat],
        VertexColor -> {Red, Green, Blue, Orange}



Kevin Coffey wrote:
> Dear Math Group,
> 
> I assume there is a really simple answer to this question, but I rarely 
> use graphics in mathematica, because as before, I wasted about two hours 
> trying to find out something really simple.  I have an Adjacency Matrix 
> that I want to convert to a Graph. No problem with this, but then I want 
> to color each vertex a specific color.  I can get them all one color or 
> alternating colors.  I though I could simply go with: 1->Red, 2->Blue, 
> etc=E2=80=A6 No such luck.  Here is where I am right now:
> 
> 
> 
> ShowLabeledGraph[FromAdjacencyMatrix[%],VertexColor->??????]
> 
> 
> 
> Any help would be most appreciated.
> 
> 
> 
> Thank you,
> 
> Kevin
> 
> 
> 
> 
> 
> 
> 
> Kevin Coffey, Ph.D.
> 
> Knowledge Management Specialist &
> 
> Scientific Affairs Officer
> 
> MDGI - UNDP Asia Pacific Regional Centre Colombo
> 
> 23 Independence Avenue, Colombo 07, Sri Lanka
> 
> Email: kevin.coffey at undp.org
> 
> Tel :- +94 (11)4526400 Ext.261
> 
> 

-- 
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


  • References:
  • Prev by Date: Re: easier method for Flatten[Position[list2,x_x...??
  • Next by Date: SaveAs in Version 6 and Version 7
  • Previous by thread: Vertex Colors
  • Next by thread: Quick help needed very much!!!!