bdendro.dendrogram_renderer function¶
-
bdendro.dendrogram_renderer(Z, threshold=None, vertical=True)[source]¶ Make a renderer of a dendrogram.
- Parameters
Z ((N - 1, 4) numpy.ndarray) – Linkage matrix returned by
scipy.cluster.hierarchy.linkagefunction.Nis the number of leaves.threshold (float or None, optional) – Height for cutting a dendrogram in subtrees. If
None, a dendrogram is not cut.vertical (bool, optional) – If
True, the height direction of a dendrogram is the y direction. IfFalse, it is the x direction.
- Returns
graph (bokeh.models.renderers.GraphRenderer) – Renderer of a dendrogram
Notes
Information about subtrees is contained in
graph.node_renderer.data_source.data['subtree']andgraph.edge_renderer.data_source.data['subtree']. They arelists of labels of subtrees to which nodes/edges belong. The label of theith subtree isstr(i). If a node/edge does not belong to any subtrees, the corresponding item is an empty string.