.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/tree/plot_skbio_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_skbio_tree.py: scikit-bio tree =============== This example shows how to use `iplotx` to plot trees from `skbio` or scikit-bio. .. GENERATED FROM PYTHON SOURCE LINES 7-24 .. code-block:: Python from io import StringIO from skbio import TreeNode import iplotx as ipx tree = TreeNode.read( StringIO( "((),((),(((),()),((),()))));", ) ) ipx.plotting.tree( tree, layout="radial", aspect=1, edge_color="purple", ) .. image-sg:: /gallery/tree/images/sphx_glr_plot_skbio_tree_001.png :alt: plot skbio tree :srcset: /gallery/tree/images/sphx_glr_plot_skbio_tree_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 25-27 `iplotx` can compute a standard rectangular tree layout as well, and usual style modifications work for trees same as networks: .. GENERATED FROM PYTHON SOURCE LINES 27-40 .. code-block:: Python ipx.plotting.tree( tree, style=[ "tree", { "edge": { "color": "deeppink", "linewidth": 4, }, }, ], ) .. image-sg:: /gallery/tree/images/sphx_glr_plot_skbio_tree_002.png :alt: plot skbio tree :srcset: /gallery/tree/images/sphx_glr_plot_skbio_tree_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.379 seconds) .. _sphx_glr_download_gallery_tree_plot_skbio_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_skbio_tree.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_skbio_tree.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_skbio_tree.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_