# How to interpret the dendrogram graph axis (hierachical clustering )?

Here is the reproducable code with dataset used

from scipy.cluster import hierarchy

import matplotlib.pyplot as plt

ytdist = np.array([662., 877., 255., 412., 996., 295., 468., 268.,400., 754., 564., 138., 219., 869., 669.])

plt.figure()

dn = hierarchy.dendrogram(Z)

# Now plot in given axes, improve the color scheme and use both vertical and horizontal orientations:

fig, axes = plt.subplots(1, 2, figsize=(8, 3))

dn1 = hierarchy.dendrogram(Z, ax=axes[0],

above_threshold_color='y',orientation='top')

dn2 = hierarchy.dendrogram(Z, ax=axes1, above_threshold_color='#bcbddc',orientation='right')

hierarchy.set_link_color_palette(None) # reset to default after use

plt.show()

Once I execute the above plot I got a plot below, I request you to assist me with interpretation of the axis !!!

My doubts are: 1. When the dataset are in the range of 138 to 996, Why the plot axis varies from 0 to 300 ? 2. What does 0,1,2,3,4,5 on the plot represent ?

• Thank you. 1. Height is the distance of what meaning which distance it refers to? What can this be compared with for this dataset ? 2. Also there is only 1 row How does the ytdist = np.array([662., 877., 255., 412., 996., 295., 468., 268.,400., 754., 564., 138., 219., 869., 669.]) has row number from 0 to 5 – Abhishek May 3 '17 at 8:35