Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Changing the X axis tick labels for a dendrogram

407 views
Skip to first unread message

Abe

unread,
Jan 31, 2004, 10:48:02 PM1/31/04
to
Hi,
I do not know how to change the XTickLabels for a dendrogram that I
created.

When I do try to change it, it does not give me the correct String for
the integer I want to replace it with.

After the creation of the dendrogram, the numbers need to correspond
with particular strings. Any help?

some of the things i tried...im a newbie so im kinda lost.

abe = set(findobj(gca,'XTickLabel','5'),'XTickLabel','putative');
set(gca,'XTickLabel',{'putative','family'});
thanks,
abe

Abe

unread,
Jan 31, 2004, 10:48:03 PM1/31/04
to
Hi,
I would like to convert the automatically assigned numbers of my
dendrogram output to be specific strings. I am a newbie to MATLAB and
was playing with set/get to change the numbers.

Nothing is working so far. Any advice?
Thanks in advance
Abe

Rob Henson

unread,
Jan 31, 2004, 11:42:16 PM1/31/04
to

"Abe" <a3c...@biomail.ucsd.edu> wrote in message
news:i0umntg6atto@legacy...

> Hi,
> I do not know how to change the XTickLabels for a dendrogram that I
> created.

One solution is to try to get hold of version 4.1 of the Statistics Toolbox.
We made this a lot easier in the new version. If you are using the Student
version or can't get hold of 4.1 for other reasons then something like this
should help.

X = rand(10,2);
Y = pdist(X,'cityblock');
Z = linkage(Y,'average');
[H, T] = dendrogram(Z);
% get the handle of the axis
hAxis = get(H(1),'parent');
% Get the permutation of the nodes
perm=str2num(get(hAxis,'XtickLabel'));
% label data
labels =
{'one','two','three','four','five','six','seven','eight','nine','ten'};
% Create the XTickLabels
set(hAxis,'XTickLabel',labels(perm))

HTH,

Rob Henson
The MathWorks, Inc.


Jojo Jacob

unread,
Apr 14, 2004, 9:35:02 AM4/14/04
to
Rob Henson wrote:
>
>

Rob Henson's script helped me label X-axis in the Dendrogram I
plotted. But I would really like to rotate the X-axis label by 90
degrees to the right. This is the only way to make the axis-labels
readable. Could any one kindly provide any help?
Jojo Jacob

ahmadreza...@gmail.com

unread,
May 15, 2020, 12:20:27 PM5/15/20
to
txn its work for me
0 new messages