.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/tree/plot_cladeedges.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_cladeedges.py: Subtrees and cascades ===================== This Biopython-inspired example shows how to style clade edges for a node and its descendants. .. GENERATED FROM PYTHON SOURCE LINES 9-39 .. image-sg:: /gallery/tree/images/sphx_glr_plot_cladeedges_001.png :alt: plot cladeedges :srcset: /gallery/tree/images/sphx_glr_plot_cladeedges_001.png :class: sphx-glr-single-img .. code-block:: Python from Bio import Phylo from io import StringIO import iplotx as ipx tree = Phylo.read( StringIO("(((A,B),(C,D)),(E,F,G));"), format="newick", ) mrca = tree.common_ancestor({"name": "E"}, {"name": "F"}) art = ipx.tree( tree, leaf_deep=True, leaf_labels=True, cascade_facecolor={ mrca: "salmon", tree.clade[0, 1]: "steelblue", }, cascade_extend=True, ) art.style_subtree( [mrca], {"edge": {"color": "purple"}}, ) art.style_subtree( [tree.clade[0, 1]], {"edge": {"color": "navy"}}, ) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.046 seconds) .. _sphx_glr_download_gallery_tree_plot_cladeedges.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_cladeedges.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_cladeedges.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_cladeedges.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_