.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/tree/plot_elements_tree.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_tree_plot_elements_tree.py: Tree element showroom ===================== This example showcases plot elements for tree styling in ``iplotx``. .. GENERATED FROM PYTHON SOURCE LINES 7-56 .. image-sg:: /gallery/tree/images/sphx_glr_plot_elements_tree_001.png :alt: plot elements tree :srcset: /gallery/tree/images/sphx_glr_plot_elements_tree_001.png :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import iplotx as ipx tree = { "name": "Vertex\nlabel", "children": [ { "children": [ {}, { "children": [{}, {}] }, ], }, {}, ], } tree = ipx.ingest.providers.tree.simple.SimpleTree.from_dict(tree) fig, ax = plt.subplots(figsize=(3.9, 3.3)) ipx.tree( tree, ax=ax, vertex_size=[0] * 6 + [(45, 35)], vertex_marker="r", vertex_facecolor=["none"] * 6 + ["orange"], vertex_alpha=0.5, vertex_edgecolor="black", vertex_linewidth=1.5, vertex_labels=True, vertex_label_hmargin=0, leaf_labels={tree.children[0].children[0]: "Leaf\nlabel"}, leaf_label_bbox_facecolor="lightcoral", leaf_label_bbox_edgecolor="black", leaf_label_bbox_alpha=0.9, leaf_deep=True, cascade_facecolor={ tree.children[0].children[1]: "gold", }, edge_linewidth=3, edge_split_linewidth=3, edge_split_linestyle=["-."] + ["-"] * 6, edge_split_color=["tomato"] + ["black"] * 6, edge_capstyle="round", edge_split_capstyle="round", margins=(0.21, 0.08), ) plt.ion(); plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.040 seconds) .. _sphx_glr_download_gallery_tree_plot_elements_tree.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_elements_tree.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_elements_tree.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_elements_tree.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_