Adjust dendrogram based on width of leaves
a vector of width. The order of width SHOULD be same as the order of original elements before clustering.
offset to x = 0
In the standard
dendrogram object, leaves locate at x = 0.5, 1.5, ..., n - 0.5,
which means, the width of leaves are always 1 and the distance to neighbouring leaves is always 1 as well.
adjust_dend_by_leaf_width adjusts the dendrogram by setting different width for leaves so that leaves
have unequal distance to other leaves.
The adjusted dendrogram can be sent to
grid.dendrogram2 to make the dendrogram.
For each branch as well each leaf, a new attribute of
x is added which is the position of the middle point or the leaf.
For each leaf, a new attribute of
width is added which is the width of current leaf.
dendrogram object. The adjustment will not affect other standard dendrogram functions.
Zuguang Gu <firstname.lastname@example.org>
1 2 3 4 5 6 7
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.