Question

I would like to adjust the x-axis in a dendrogram where all the labels are seen, for large data sets. As example, I use iris data here:

    > iris.data=subset(iris,select=-Species)

    > d <- dist(iris.data, method="euclidean")

    > hc <- hclust(d, "ward")

    > plot(hc, hang=-1, main="Dendrogram of Ward's Method", label=iris$Species)

After the plot function is used, the dendrogram will be like this:

enter image description here

So, how I'm going to adjust the x-axis so then all the species are all clear seen.

Was it helpful?

Solution

Like @Roman Luštrik said : You can do like this :

  png("plotdendogram.png",width=1600,height=800)

  par(cex=1,font=3)
  plot(hc, hang=-1, main="Dendrogram of Ward's Method", label=iris$Species)

  dev.off()

You will be able to view species' names, although in small font size. Hope this helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top