Skip to content

wrong leaves determination of _dendrogram.py #1181

Closed
@444thLiao

Description

@444thLiao

When I using the function for creating dendrogram, I meet some wrong presentation of the leaves.
all zero leaves

In your code(~/.local/lib/python3.6/site-packages/plotly/figure_factory/_dendrogram.py), we can see that
original code which come from ~/.local/lib/python3.6/site-packages/plotly/figure_factory/_dendrogram.py

Above code without comment is the original code for determination the y axis tick or labels. In the first image I provide, you can see that 138-140 line code will raise silent error which mean wrong alignment of leaves of dendrogram and labels.

So I make a litter bit revise of this by 142-145 code (Of course without comment and I have use this in my computer, as far as I see, it will not raise any conflict.) .

Here is the code

        if len(self.zero_vals) > len(yvals) + 1:
            l_border = int(min(self.zero_vals))
            r_border = int(max(self.zero_vals))
            self.zero_vals = [v for v in range(l_border,r_border + 1, int((r_border-l_border) / len(yvals)))]

#1180

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsomething broken

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions