Quantcast
Viewing all articles
Browse latest Browse all 22

Plotting hclust

After many years I’ve finally worked out the x and y coordinates of the points in plot.hclust.

hang <- 0.07
hc <- hclust(dist)
plot(hc)
pt.heights <- c(hc$height[hc$merge[,1] < 0],hc$height[hc$merge[,2] < 0])[order(-1 * c(hc$merge[,1][hc$merge[,1] < 0],hc$merge[,2][hc$merge[,2] < 0]))]
points(1:length(hc$order), pt.heights[hc$order] - hang)

Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.

Viewing all articles
Browse latest Browse all 22

Trending Articles