How to suppress dendrogram drawing, but still a cluster in the sea?

I want to build a cluster map in the sea, grouped by row and column. I do not want to draw dendrograms.

Setting row_cluster=False or col_cluster=False removes dendrograms, but also stops clustering.

How to make a 2D cluster but suppress dendrograms?

This question allows you to crack the width of the dendrogram lines to 0. This hack does not work in marine 0.7.1 .

+5
source share
1 answer

The answer is in the documentation.

Let cg be the mapmap instance returned by Seaborn.

After drawing the cluster map, enter the following to remove the line dendrogram.

cg.ax_row_dendrogram.set_visible(False)

If you want to keep the legend, enter:

cg.ax_row_dendrogram.set_xlim([0,0])

It's a hack, but set_axis_off() doesn't seem to do in Seaborn what it does in matplotlib.

+6
source

Source: https://habr.com/ru/post/1264627/


All Articles