问题
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:
So, how I'm going to adjust the x-axis so then all the species are all clear seen.
回答1:
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.
来源:https://stackoverflow.com/questions/11444743/how-to-adjust-sizes-of-x-axis-in-dendrogram-r