[R] plot.hclust with lots of objects

Martin Maechler maechler at stat.math.ethz.ch
Wed Jun 19 17:25:50 CEST 2002

>>>>> "Michael" == Michael Dondrup <Michael.Dondrup at Genetik.Uni-Bielefeld.DE> writes:

    Michael> I found that converting my hclust object to a
    Michael> dendrogram and cutting it with cut.dendrogram, does
    Michael> almost what I want, showing only a branch of the
    Michael> tree.  But now my labels in the plot are gone,
    Michael> although they appear in the dendrogram object
    Michael> itself, when printed.  How can I bring them back?

plot.dendrogram() is still not as good as it should be.
R-devel has an improved version -- which still isn't good

But for hierarchical clustering results (hclust being one kind;
    there are agnes(), diana() and others in the "cluster" package), 
you shouldn't need the detour through dendrograms at all.

cutree() is the function to cut hclust objects; returning
grouping vectors only

but the `maptree' package has a  prune.clust function (andmore).

Hoping this helps, yours,

Martin Maechler <maechler at stat.math.ethz.ch>	http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum  LEO C16	Leonhardstr. 27
ETH (Federal Inst. Technology)	8092 Zurich	SWITZERLAND
phone: x-41-1-632-3408		fax: ...-1228			<><

    Michael> Laurent Gautier wrote:
    >>  On Sat, Jun 15, 2002 at 11:11:31PM +0200, Michael
    >> Dondrup wrote: > Dear all,
    >> >
    >> > the default plotting method for hclust trees looks just
    >> fine for few > objects like in the > example dataset. But
    >> when it comes to many objects (some 1000 - I'm > trying
    >> to visualize clustered microarray data) it renders a
    >> tree, that > one cannot inspect, because of overlapping
    >> text and lines. My question > is, is there a way or a
    >> plotting parameter for plotting a tree which is > wide
    >> enough to have all leaves separated and readable labels
    >> even for > that many objects?  > This would produce a
    >> very big image, so I think scrolling is essential.
    >> >
    >> > I believe the answer is simple, but I'm unable to
    >> figure it out.
    >> >
    >> > Thanks in advance > Michael
    >> Dear Michael,
    >> For the labels, you may want to try use smaller
    >> characters to dsiplay them.  This can be done using the
    >> incantation: par(cex=0.5) # for example
    >> For the overlapping lines, well I think there is not much
    >> to do except magnifying. Did you try to save your plot in
    >> a format like postscript or pdf then display it with a
    >> wiever that let you zoom in ?
    >> Ultimately, you can try to prune your tree and inspect
    >> specific branches (I send you to R help files in this
    >> case)
    >> Hopin' it helps,
    >> Laurent
    >> --------------------------------------------------------------
    >> Laurent Gautier CBS, Building 208, DTU PhD. Student
    >> DK-2800 Lyngby,Denmark tel: +45 45 25 24 85
    >> http://www.cbs.dtu.dk/laurent
    >> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
    >> r-help mailing list -- Read
    >> http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send
    >> "info", "help", or "[un]subscribe" (in the "body", not
    >> the subject !)  To: r-help-request at stat.math.ethz.ch
    >> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
    Michael> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
    Michael> r-help mailing list -- Read
    Michael> http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
    Michael> Send "info", "help", or "[un]subscribe" (in the
    Michael> "body", not the subject !)  To:
    Michael> r-help-request at stat.math.ethz.ch
    Michael> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list