Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Draw dendrogram in python manually

I have implemented an algorithm to solve the problem of clustering in a graph. I used the python library "python-graph" to represent the graph. Now, at each step of my computation (the algorithm is iterative) I have to draw a part of the dendrogram. In fact, the algorithm is divisive, in the sense that starting from the original graph calculates the clusters. Now, I don't know what to use to draw the dendrogram (someone suggested PIL, but I'm looking for something easy and I don't know how to use PIL)... can you suggest something and show me how to do plot with it?

Note: I read other questions but everything seems to use methods that use automatic computation of the clusters... this is not what I'm looking for: I need to manually draw the dendrogram or at least find a way to represent the clusters computed to be drawn.

Thanks!

like image 304
Raffo Avatar asked Jun 26 '11 13:06

Raffo


2 Answers

Code to implement scipy dendrogram can be found here and this simple implementation will help you to move on.

like image 50
eat Avatar answered Sep 29 '22 07:09

eat


perhaps an other solution could be this one: http://ete.cgenomics.org/ I recommend you the main help pdf to start: http://ete.cgenomics.org/releases/ete2/doc/ete_tutorial.pdf

like image 27
fransua Avatar answered Sep 29 '22 07:09

fransua