.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/tree/plot_support.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_support.py: Branch support ============== This example shows how to visualise support values for clades or branches. .. GENERATED FROM PYTHON SOURCE LINES 7-23 .. code-block:: Python import cogent3 import matplotlib.pyplot as plt import iplotx as ipx tree = cogent3.load_tree("data/tree-with-support.json") fig, ax = plt.subplots(figsize=(5, 4)) art = ipx.tree( tree, ax=ax, leaf_labels=True, style="cogent3", show_support=True, ) .. image-sg:: /gallery/tree/images/sphx_glr_plot_support_001.png :alt: plot support :srcset: /gallery/tree/images/sphx_glr_plot_support_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 24-25 The location of the support vertex labels can be tuned: .. GENERATED FROM PYTHON SOURCE LINES 25-50 .. code-block:: Python fig, axs = plt.subplots(2, 1, figsize=(5, 9)) art = ipx.tree( tree, ax=axs[0], leaf_labels=True, style="cogent3", show_support=True, vertex_label_hmargin=-1, vertex_label_vmargin=5, vertex_label_horizontalalignment="right", title="Move top left, right-aligned", ) art = ipx.tree( tree, ax=axs[1], leaf_labels=True, style="cogent3", show_support=True, vertex_label_hmargin=+1, vertex_label_vmargin=0, vertex_label_horizontalalignment="left", title="Move center right, left-aligned", ) .. image-sg:: /gallery/tree/images/sphx_glr_plot_support_002.png :alt: Move top left, right-aligned, Move center right, left-aligned :srcset: /gallery/tree/images/sphx_glr_plot_support_002.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 51-55 .. warning:: Using `show_support=True` overrides vertex labels. At the moment it is not possible to set both support values and external vetex labels. Of course, you can craft your own vertex labels to include support values if you want. .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.268 seconds) .. _sphx_glr_download_gallery_tree_plot_support.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_support.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_support.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_support.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_