{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Default color\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The default color is applied to parts of a dendrogram that do not belong to any subtrees. By\ndefault, it is the first color of the :attr:`~plotly.graph_objects.Layout.colorway` attribute of\nthe :attr:`~plotly.graph_objects.Figure.layout` attribute of a figure. This can be changed using\nthe `default_color` parameter.\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import plotly.graph_objects as go\nimport plotly.io as pio\nimport scipy\n\nfrom pdendro import attach_dendrogram\n\nX = [[0.0], [1.0], [3.0], [6.0]]\nZ = scipy.cluster.hierarchy.linkage(X)\n\nfig = go.Figure()\nattach_dendrogram(fig, Z, default_color=\"#000000\")\npio.show(fig)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.14.4" } }, "nbformat": 4, "nbformat_minor": 0 }