Loading [MathJax]/jax/output/HTML-CSS/config.js
scipy 1.10.1 Pypi GitHub Homepage
Other Docs

Returns
_dendrogram_calculate_info(Z, p, truncate_mode, color_threshold=inf, get_leaves=True, orientation='top', labels=None, count_sort=False, distance_sort=False, show_leaf_counts=False, i=-1, iv=0.0, ivl=[], n=0, icoord_list=[], dcoord_list=[], lvs=None, mhr=False, current_color=[], color_list=[], currently_below_threshold=[], leaf_label_func=None, level=0, contraction_marks=None, link_color_func=None, above_threshold_color='C0')

ivl is a list to store the labels of the leaf nodes. The leaf_label_func is called whenever ivl != None, labels == None, and leaf_label_func != None. When ivl != None and labels != None, the labels list is used only for labeling the leaf nodes. When ivl == None, no labels are generated for leaf nodes.

When get_leaves==True, a list of leaves is built as they are visited in the dendrogram.

Returns a tuple with l being the independent variable coordinate that corresponds to the midpoint of cluster to the left of cluster i if i is non-singleton, otherwise the independent coordinate of the leaf node if i is a leaf node.

Returns

A tuple (left, w, h, md), where:
  • left is the independent variable coordinate of the center of the the U of the subtree
  • w is the amount of space used for the subtree (in independent variable units)
  • h is the height of the subtree in dependent variable units
  • md is the max(Z[*,2]) for all nodes * below and including the target node.

Calculate the endpoints of the links as well as the labels for the the dendrogram rooted at the node with index i. iv is the independent variable value to plot the left-most leaf node below the root node i (if orientation='top', this would be the left-most x value where the plotting of this root node i and its descendents should begin).

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /scipy/cluster/hierarchy.py#3466
type: <class 'function'>
Commit: