Re: LeafLabels
- To: mathgroup at smc.vnet.net
- Subject: [mg89843] Re: LeafLabels
- From: magma <maderri2 at gmail.com>
- Date: Sun, 22 Jun 2008 03:24:40 -0400 (EDT)
- References: <g3ihno$fbk$1@smc.vnet.net>
On Jun 21, 11:30 am, Thomas <thomas.wilh... at bbsrc.ac.uk> wrote:
> hi
>
> does anybody know how to assign LeafLabels to a tree in DendrogramPlot[Agglomerate[...]]?
>
> using DendrogramPlot[...,LeafLabels->...] directly works, but not via the explicit cluster object
>
> thanks
>
> thomas
Hi Thomas,
another nice question on cluster analysis, that I just learned,
stimulated by your posts!
Let's say you have your data
data = {{1, 2, 2}, {1, 3, 3}, {2, 4, 2}, {5, 4, 3}, {5, 4, 4}, {7, 6,
7}};
you can make a DendrogramPlot using the data themselves as labels for
the leaves.
DendrogramPlot[data, LeafLabels -> (# &)]
or you can label the data creating/using a list of labels.
Example with strings (since you have very little data),
labels = CharacterRange["a", "f"]
DendrogramPlot[data, LeafLabels -> labels]
....or with numbers
labels = Range[data // Length]
DendrogramPlot[data, LeafLabels -> labels]
happy clustering :-)