I'm able to plot a dendrogram with hclust class, but when I'm trying to convert it to as.phylo in ape package it gives me the error for the plot
Error in plot.window(...) : need finite 'xlim' values
Any idea what can cause the problem?
Thanks,
mymerge<-Merg_Mat
myheight<-cumsum(abs(diff(ll)))
myhclust=list(order=lab,merge=mymerge,height=myheight)
class(myhclust)="hclust"
plot(as.phylo(myhclust),edge.col=colors,edge.width = 2, edge.lty =1,font=1)
My guess would be that the figure is too big for your window, try to output it into a file.
If you read the
plot.phylo
function code, you'll see thatxlim
is set toc(0, depth_of_your_tree)
. So if it is too big for the device (window or postscript, see here, it simply is because your tree is too deep.PDF maximum page size is so big it should be able to hold your figure.