{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Horizontal layout\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "A horizontal dendrogram is drawn if the `direction` parameter is ``'horizontal'``.\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, direction=\"horizontal\")\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 }