hierarchical clustering doesn't work as expected
Likely your precomputed distance matrix is bad.

Judging from your plot, it's probably a half-filled similarity matrix instead. And it likely is not in the required form for linkage.


  The input y may be either a 1d condensed distance matrix or a 2d array of observation vectors.


Did you make your distance matrix "condensed"? Otherwise it will be treated as data matrix, not distance matrix, because python does not have type safety but uses duck typing - if it quacks like a data matrix, it is a data matrix. Then you end up computing Euclidean distances on half-filled rows of this matrix...