Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ylim in hclust plot

Tags:

plot

r

dendrogram

I have this simple code to draw a dendrogram but the feature ylim seems not to work. So no matter what I set it to it has a y range of [0,0.5] when drawn.

Should I use another parameter for setting the ylim when drawing dendrograms?

plot(hclust(total_dist),main=NULL,ylab=NULL,ylim=c(0,1))

enter image description here

like image 516
hora Avatar asked Jul 29 '13 13:07

hora


1 Answers

You could use as.dendrogram:

hc <- hclust(dist(USArrests)/200, "ave")
plot(hc)
plot(hc, ylim = c(0,1))  # negative case
plot(as.dendrogram(hc))
plot(as.dendrogram(hc), ylim = c(0,1))  # positive case
like image 190
EDi Avatar answered Sep 22 '22 15:09

EDi