bdendro.subtree_cmap function

bdendro.subtree_cmap(dendrogram, palette, default_color=None, skip_single=True)[source]

Make a mapping from a subtree label to a color.

Parameters
  • dendrogram (bokeh.models.renderer.GraphRenderer) – Renderer returned by bdendro.dendrogram_renderer function.

  • palette (list[str]) – Colors of subtrees. If default_color is None, the first item is removed and used for it.

  • default_color (str or None, optional) – Default color of a tree. If None, the first item of palette is removed and used for this.

  • skip_single (bool, optional) – If True, a subtree consisting of a single node is colored with default_color.

Returns

cmap (dict) – Mapping from a subtree label to a color.