[R] graphic of hierachical clustering

Gavin Simpson gavin.simpson at ucl.ac.uk
Mon Sep 8 11:33:29 CEST 2003

Hi Martin,

try ?plot.default

which states:

frame.plot: a logical indicating whether a box should be drawn around
           the plot.

So the following:

postscript(file = "hc605.ps")
plot(as.dendrogram(reshc), horiz = TRUE, ylab = "", main = " ",
	frame.plot = FALSE)

should get you what you want.

plot.dendrogram doesn't explicitly mention frame.plot, but the ... 
allows you to pass plotting parameters to other methods:

..., xlab, ylab: graphical parameters, or arguments for other methods.

As for the postscript -> gif - I'm not qualified to explain this, except 
that it must have something to do with the fact that by doing 
box(col="white") you aren't actually *deleting* the box, you are just 
overplotting on it.



Martin Olivier wrote:

> Hi all,
> I would like to save the dendrogram of a hierarchical clustering.
> Let reshc the result of the fucntion hclust(). To save the dendrogram,
> I can use the function postscript:
> postscript(file="hc605.ps")
> plot(as.dendrogram(reshc),horiz=T,ylab="",main=" ")
> dev.off()
> Using the functions plot and as.dendrogram, it is possible to obtain an 
> horizontal tree with option horiz=T.
> The problem is there is a box around the tree...this box looks like the 
> result of the function box() and it is possible
> to delete it with box(col="white"). But when I convert the postscript 
> file in gif or tiff file, this box  is not deleted.
> Could you explain me why this box appear after the conversion of my 
> postscript file and a solution
> to delete this box in a gif or tiff format? (I know I can use 
> plot(reshc) but the tree is vertical   in this case)
> Regards,
> Olivier.

Gavin Simpson                     [T] +44 (0)20 7679 5522
ENSIS Research Fellow             [F] +44 (0)20 7679 7565
ENSIS Ltd. & ECRC                 [E] gavin.simpson at ucl.ac.uk
UCL Department of Geography       [W] http://www.ucl.ac.uk/~ucfagls/cv/
26 Bedford Way                    [W] http://www.ucl.ac.uk/~ucfagls/
London.  WC1H 0AP.

More information about the R-help mailing list