title: Associated Labels in a dendrogram plot - MATLAB
body: <p>I have the following set of data stored in file <code>stations.dat</code> :</p>
  
  <pre><code>       Station A 305.2 321.1 420.9 383.5 311.7 197.1 160.2 113.9 60.5 60.5 64.8 154.3
         Station B 281.1 304.0 353.1 231.9 84.6 20.9 11.7 11.9 31.1 75.8 133.0 235.3
         Station C 312.3 342.2 366.2 335.2 200.1  74.4 45.9   27.5 24.0   53.6 87.7 177.0
         Station D 402.2 524.5 554.9 529.5 347.5  176.8 120.2 35.0 12.6 13.3 14.0 61.6
         Station E 261.3 262.7 282.3 232.6 103.8  33.2 16.7   33.2 111.0  149.0 184.8 227.0
  </code></pre>
  
  <p>By using the following commands,</p>
  
  <pre><code>Z = linkage (stations.data,'ward','euc'); 
  figure (1), dendrogram(Z,0,'orientation', 'right')
  </code></pre>
  
  <p>I get the figure below:
  <img src="https://i.stack.imgur.com/juaa6.png" alt="enter image description here"></p>
  
  <p>So cluster 1 components are 4,3,1 (Stations D,C and A, respectively) and cluster 2 are 5,2(Stations E and B).</p>
  
  <p>I want to put the name of Stations on plot, but if I use the command:</p>
  
  <pre><code>set (gca,'YTickLabel', stations.textdata);
  </code></pre>
  
  <p>The figure I get is the following:
  <img src="https://i.stack.imgur.com/AWgKt.png" alt="enter image description here"></p>
  
  <p>How can I associate data to respective names and plot in dendrogram.
  I have 144 stations data. I used only 5 for illustration.</p>