title: dendrogram in python
body: <p>I am wanting to write code to draw a dendrogram in python. is there a simple way of going about it. </p>
  
  <p>I have written code that identifies clusters in a point dataset and want to produce a dendrogram that shows the amount of clusters produced for each iteration</p>
  
  <p>for example when i run my code on this dataset i get 1 cluster the first iteration</p>
  
  <p><img src="https://i.stack.imgur.com/RIUph.png" alt="enter image description here"></p>
  
  <p>and 2 clusters the second iteration </p>
  
  <p><img src="https://i.stack.imgur.com/nYHKW.png" alt="enter image description here"></p>
  
  <p>so i would like to produce something that shows this. but don't really know where to start</p>
  
  <p><img src="https://i.stack.imgur.com/E2Eol.png" alt="enter image description here"></p>
  
  <p>each point has a 'label' attribute which is a list of each cluster the point was in after each iteration.</p>
  
  <p>i.e. in this example some of the points label attribut  is <code>[0,0]</code> and the others are <code>[0,1]</code>. so if i were to use scipy dendrogram how would i got from this to the linkage format </p>