[R] plot.hclust with lots of objects

Thomas Petzoldt thpe at simecol.de
Sat Nov 8 11:11:30 CET 2008

Hi Paul,

one possibility: write the tree to a wide pdf file and then zoom and 
scroll using Adobe Acrobat or another PDF reader. Here is a tree with 
1000 objects:

x <- matrix(rnorm(3000), nrow=1000)
hc <- hclust(dist(x))
pdf("tree.pdf", width=150)

Thomas P.

paul murima 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
 > features (eg some 1000 and more - 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
 > --
 > Paul Murima
 > ______________________________________________
 > R-help at r-project.org mailing list
 > https://stat.ethz.ch/mailman/listinfo/r-help
 > PLEASE do read the posting guide 
 > and provide commented, minimal, self-contained, reproducible code.

Thomas Petzoldt
Technische Universitaet Dresden
Institut fuer Hydrobiologie        thomas.petzoldt at tu-dresden.de
01062 Dresden                      http://tu-dresden.de/hydrobiologie/

More information about the R-help mailing list