.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/zero_dependency/plot_simpletreedataprovider.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_zero_dependency_plot_simpletreedataprovider.py: Zero-dependency trees ===================== This example demonstrates how to visualise trees using `iplotx`'s internal `SimpleTree`, a simple tree representation via the ``children`` attribute. .. tip:: This provider is not as powerful as proper tree libraries such as ``cogent3`` or ``ETE4``. It can be especially useful when you do not want to add dependencies or for educational purposes. .. GENERATED FROM PYTHON SOURCE LINES 12-44 .. code-block:: Python import iplotx as ipx tree = { "children": ( {}, { "children": ( { "children": ( {"branch_length": 1.5}, {} ) }, { "children": ( {}, {} ) } ) } ) } # Convert to our simple tree data structure tree = ipx.ingest.providers.tree.simple.SimpleTree.from_dict(tree) ipx.tree( tree, ) .. image-sg:: /gallery/zero_dependency/images/sphx_glr_plot_simpletreedataprovider_001.png :alt: plot simpletreedataprovider :srcset: /gallery/zero_dependency/images/sphx_glr_plot_simpletreedataprovider_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 45-49 .. note:: ``iplotx`` does not generally provide network or tree data structures. This is an exception to demonstrate how to visualise trees without external dependencies. .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.029 seconds) .. _sphx_glr_download_gallery_zero_dependency_plot_simpletreedataprovider.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_simpletreedataprovider.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_simpletreedataprovider.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_simpletreedataprovider.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_