From Laura.Herbst at mpi.nl Thu Mar 6 12:34:05 2008 From: Laura.Herbst at mpi.nl (Laura Herbst) Date: Thu, 6 Mar 2008 21:34:05 +0100 (CET) Subject: [R-lang] colourcoding of leaves in dendrogram Message-ID: <49325.62.131.14.105.1204835645.squirrel@62.131.14.105> Hi R-users I have plotted a dendrogram from a diana() object. The leaves are always one out of three categories (e.g. with the labels "1","2","3"). I would like to visualize the distribution of those categories with colours, so that for example all leaves labelled "1" get the color "green", and leaves labelled "2" the color "red" etc. Does anyone have a suggestion how to do this? Thank you! Best Laura From stgries at gmail.com Thu Mar 6 12:50:35 2008 From: stgries at gmail.com (Stefan Th. Gries) Date: Thu, 6 Mar 2008 12:50:35 -0800 Subject: [R-lang] colourcoding of leaves in dendrogram In-Reply-To: <49325.62.131.14.105.1204835645.squirrel@62.131.14.105> References: <49325.62.131.14.105.1204835645.squirrel@62.131.14.105> Message-ID: Hi I don't have a solution off the top of my head, but you can look here: and then explore the source code provided. HTH at least a bit, STG -- Stefan Th. Gries ----------------------------------------------- University of California, Santa Barbara http://www.linguistics.ucsb.edu/faculty/stgries ----------------------------------------------- On Thu, Mar 6, 2008 at 12:34 PM, Laura Herbst wrote: > Hi R-users > > I have plotted a dendrogram from a diana() object. The leaves are always > one out of three categories (e.g. with the labels "1","2","3"). I > would like to visualize the distribution of those categories with > colours, so that for example all leaves labelled "1" get the color > "green", and leaves labelled "2" the color "red" etc. > Does anyone have a suggestion how to do this? > > Thank you! > > Best > Laura